replicah
07-08-2005, 05:10 AM
I want to change the image when clicked, and then change back when clicked again.
it changes the first time, but then doesnt change back
function:
function changeplus(theid){
var theid=document.getElementById(theid);
theid.src=(theid.src=='Images/moredetailminus.gif')? 'Images/moredetailplus.gif' : 'Images/moredetailminus.gif';
}
body:
<span onClick="updatenewsdisplay(<?=$row2['id']?>);
changeplus('<?=$row2['id']?>plus');"
style="cursor:help; color: #006699;">
<img id="<?=$row2['id']?>plus" src="Images/moredetailplus.gif"></span>
any ideas why it isnt working?
Thankyou!!!
it changes the first time, but then doesnt change back
function:
function changeplus(theid){
var theid=document.getElementById(theid);
theid.src=(theid.src=='Images/moredetailminus.gif')? 'Images/moredetailplus.gif' : 'Images/moredetailminus.gif';
}
body:
<span onClick="updatenewsdisplay(<?=$row2['id']?>);
changeplus('<?=$row2['id']?>plus');"
style="cursor:help; color: #006699;">
<img id="<?=$row2['id']?>plus" src="Images/moredetailplus.gif"></span>
any ideas why it isnt working?
Thankyou!!!