budapestnori
Technical User
I want to have a script that when run, can dynamically change the value of a <a> tag's href value. The reason being is I have an asp page for a photography gallery which has an div element in which images are displayed. I have several links on this page which allow the user to change the background of the div element.
It is done like this:
function changeColor(xyz) {
var x;
var z;
x = xyz.currentStyle[ "backgroundColor" ];
z = xyz.currentStyle[ "color" ];
document.getElementById('container').style.backgroundColor = x;
document.getElementById('container').style.color = z;
return;
}
Ok, well on this asp gallery asp page, I also have links which href itself. ie., <a href="gallery.asp?type=wedding">
Wedding</a>
But when the background is changed, I want to change the href value to "gallery.asp?type=wedding&bgcolor=#f00&color=#000"
Can this be done?
Thanks so much
It is done like this:
function changeColor(xyz) {
var x;
var z;
x = xyz.currentStyle[ "backgroundColor" ];
z = xyz.currentStyle[ "color" ];
document.getElementById('container').style.backgroundColor = x;
document.getElementById('container').style.color = z;
return;
}
Ok, well on this asp gallery asp page, I also have links which href itself. ie., <a href="gallery.asp?type=wedding">
Wedding</a>
But when the background is changed, I want to change the href value to "gallery.asp?type=wedding&bgcolor=#f00&color=#000"
Can this be done?
Thanks so much