JavaScript causes errors in XHTML validation

Soldato
Joined
2 Nov 2002
Posts
3,304
Location
Aberdeen
I know this happens, and i know why etc, but is there any way i can stop this happening?

for example, i have links that when rolled over, change.

Code:
image1 = new Image();
image1.src = "link1.gif";

...

...

Code:
<a href="www.home.com" onmouseover="image1.src='link1.gif';" onmouseout="image1.src='link1n.gif';">
<img name="image1" src="link1n.gif" alt="hi"></a>

I've managed to put the first part into CSS, but i'm still greeted with the error

"there is no attribute "name"."

Is there another calling for "name"?
 
Last edited:
Taking away the "name="image1" and replacing it with id="image1" seems to do the trick...

Thanks anyways, err i guess.
 
Thanks for the link.

Could you also tell me whether or not i should code it in xhtml 1.1 or xhtml 2.0? Does it really matter?, a little brief question here i know, but i was wondering.

I tried in xhtml 2.0 but i couldn't get the conformance definition set up correctly so i gave up lol.
 
Ah ok thank you, i was wondering why it was coming up with all those errors, even though i done exactly as stated on the site.
 
Back
Top Bottom