I have the following Javascript code that doesn't seem to work:
No matter what I try or what I do, I can't seem to get it to work in either FF or IE6. If I change the image to a div, and change the src to innerhtml it works fine, but I can't change the image srcs (While in an if statement - If it isn't in an if statement, it works fine, but only one way which defeats the purpose of it)
Thanks for any help anyone has
- Garion
| Code: |
|
<script language="javascript"> function switchupdown($i){ if (document.getElementById($i).src == 'images/down.png') document.getElementById($i).src = 'images/up.png'; else document.getElementById($i).src = 'images/down.png'; } </script> .... <span id="Name" onclick="switchupdown('imgname');">Garion <img src="images/down.png" alt="down" id="imgname" /></span> |
No matter what I try or what I do, I can't seem to get it to work in either FF or IE6. If I change the image to a div, and change the src to innerhtml it works fine, but I can't change the image srcs (While in an if statement - If it isn't in an if statement, it works fine, but only one way which defeats the purpose of it)
Thanks for any help anyone has
- Garion
