johnnyG
05-27-2003, 08:48 AM
I used this code for a webpage:
<img src="pil1.gif" name="pil1" width="10" height="5" alt="" /> <a href="links.html" onmouseover="document.pil1.src='pil.gif'; document.pil2.src='pil2.gif'; return true" onmouseout="document.pil1.src='pil1.gif';document.pil2.src='pil3.gif'; return true">Links</a> <img src="pil3.gif" name="pil2" width="10" height="5" alt="" />
And this code works great. But when I changed my homepage to XHTML, I can't use NAME in img-tag, instead I use ID. But then I got a javascript error and it doesn't work:
<img src="pil1.gif" id="pil1" width="10" height="5" alt="" /> <a href="links.html" onmouseover="document.pil1.src='pil.gif'; document.pil2.src='pil2.gif'; return true" onmouseout="document.pil1.src='pil1.gif';document.pil2.src='pil3.gif'; return true">Links</a> <img src="pil3.gif" id="pil2" width="10" height="5" alt="" />
Please help me to get this onMouseOver to work so its valid XHTML? Why doesn't it work?
<img src="pil1.gif" name="pil1" width="10" height="5" alt="" /> <a href="links.html" onmouseover="document.pil1.src='pil.gif'; document.pil2.src='pil2.gif'; return true" onmouseout="document.pil1.src='pil1.gif';document.pil2.src='pil3.gif'; return true">Links</a> <img src="pil3.gif" name="pil2" width="10" height="5" alt="" />
And this code works great. But when I changed my homepage to XHTML, I can't use NAME in img-tag, instead I use ID. But then I got a javascript error and it doesn't work:
<img src="pil1.gif" id="pil1" width="10" height="5" alt="" /> <a href="links.html" onmouseover="document.pil1.src='pil.gif'; document.pil2.src='pil2.gif'; return true" onmouseout="document.pil1.src='pil1.gif';document.pil2.src='pil3.gif'; return true">Links</a> <img src="pil3.gif" id="pil2" width="10" height="5" alt="" />
Please help me to get this onMouseOver to work so its valid XHTML? Why doesn't it work?