extrovertive Posted August 6, 2006 Share Posted August 6, 2006 I have rollover images on my site. It uses <img name="thename" ....> for the javascript to work. Now, when I tried to validate my site with XHTML strict, I get a warning that the "name" in invalid/deprecated. Now, what do I use do then? Quote Link to comment https://forums.phpfreaks.com/topic/16688-not-xhtml/ Share on other sites More sharing options...
extrovertive Posted August 6, 2006 Author Share Posted August 6, 2006 ah nevermind. I use "id" Quote Link to comment https://forums.phpfreaks.com/topic/16688-not-xhtml/#findComment-70111 Share on other sites More sharing options...
Daniel0 Posted August 7, 2006 Share Posted August 7, 2006 [code]<img src="image1.gif" onmouseover="image2.gif" onmouseout="image1.gif" />[/code]Would do it without IDs or names. Quote Link to comment https://forums.phpfreaks.com/topic/16688-not-xhtml/#findComment-70697 Share on other sites More sharing options...
obsidian Posted August 7, 2006 Share Posted August 7, 2006 using id is perfectly legitimate in XHTML. this is actually the easiest way to reference an img tag, however, like daniel0 shows in his example, you've got to make your images self-closing tags. the other problem that you might be facing (that daniel0 doesn't show) is that for valid XHTML, you also must have an alt attribute, even if it is empty. Quote Link to comment https://forums.phpfreaks.com/topic/16688-not-xhtml/#findComment-70718 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.