Send to a Friend

nashish's avatar

How do I code image rollovers in XHTML?

In this HTML textbook I have it says to code rollovers in the following way:

<a href=“http://www.nashish.com/index.html” onmouseover=“document.logo.src=‘images/naw.png’” onmouseout=“document.logo.src=‘images/nawgrey.png’”><img src=“images/nawgrey.png” name=“logo” width=“400” height=“171” alt=“Site Logo” /></a>

This does create a rollover successfully, but when I validate this code, I am told that the attribute “name” doesn’t exist in strict XHTML. How can I get my desired effect and have valid code too?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.

Mobile | Desktop


Send Feedback   

`