Howto validate this html...?

T

Tom

<a href="index.jsp"><img src="images/home.gif" width="81" height="21"
alt="Home" name="home" onmouseover="home.src = homeon.src"
onmouseout="home.src = homeoff.src" /></a>

I am having a problem validating the name="home" part of this html...
Any thoughts on how I can make it validate without having to rejig/rewrite
the javascript?

Thanks for any thoughts.
Tom
 
M

Mitja

Tom said:
<a href="index.jsp"><img src="images/home.gif" width="81" height="21"
alt="Home" name="home" onmouseover="home.src = homeon.src"
onmouseout="home.src = homeoff.src" /></a>

I am having a problem validating the name="home" part of this html...
Any thoughts on how I can make it validate without having to
rejig/rewrite the javascript?

Thanks for any thoughts.
Tom

Name parameter only applies to form elements; use id instead.
 
S

Steve Pugh

Tom said:
<a href="index.jsp"><img src="images/home.gif" width="81" height="21"
alt="Home" name="home" onmouseover="home.src = homeon.src"
onmouseout="home.src = homeoff.src" /></a>

I am having a problem validating the name="home" part of this html...
Any thoughts on how I can make it validate without having to rejig/rewrite
the javascript?

Which version of HTML are you validating against?

name is valid as an attribute of img in all versions of HTML 4.01 and
in XHTML 1.0 Transitional. I'm guessing that you're trying to use
XHTML 1.0 Strict. Do you have any strong reasons to use that over HTML
4.01 Strict?

Using id instead of name won't require any major changes to the
JavaScript but will stop the rollover working in some older browsers.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top