wynton_ca
05-27-2003, 01:07 PM
I was hoping someone could help me with this problem Im facing. I have this code which swaps the link display name, but I need it to swap an image.
the .js:
function toggle_innertext_display(thisElement,displayedText1,displayedText2) {
if (thisElement.innerHTML == displayedText1) {
thisElement.innerHTML = displayedText2;
}
else if (thisElement.innerHTML == displayedText2) {
thisElement.innerHTML = displayedText1;
}
else {
thisElement.innerHTML = displayedText1;
}
}
The anchor link which calls the function:
<a href="#" onclick="toggle_innertext_display(this,'Show Details','Hide Details');"><img src="/root/images/tabs/tab_show_details.gif" width="113" height="27" alt="Show Details" border="0"></a>
Thanks!
wynton
the .js:
function toggle_innertext_display(thisElement,displayedText1,displayedText2) {
if (thisElement.innerHTML == displayedText1) {
thisElement.innerHTML = displayedText2;
}
else if (thisElement.innerHTML == displayedText2) {
thisElement.innerHTML = displayedText1;
}
else {
thisElement.innerHTML = displayedText1;
}
}
The anchor link which calls the function:
<a href="#" onclick="toggle_innertext_display(this,'Show Details','Hide Details');"><img src="/root/images/tabs/tab_show_details.gif" width="113" height="27" alt="Show Details" border="0"></a>
Thanks!
wynton