Link to home
Start Free TrialLog in
Avatar of james130c
james130cFlag for United Kingdom of Great Britain and Northern Ireland

asked on

XHTML mouseover validation

Hi my XHTML document is passed validation, it doesn't pass validation with the 'name' tag, so i changed it to 'id' which is fine for validation, but the mouseover doesn't actually work when i change it to 'id' but it works with 'name' so im a little stuck, can abody tell me a way around this matter?.
Avatar of _Maddog_
_Maddog_
Flag of United States of America image

Hi james130c,

What do you mean "the mouseover doesn't actually work when i change it to 'id'"?
Can you provide a code sample of what you're trying to accomplish?

- Maddog
Avatar of Michel Plungjan
<a href="#"
onMouseover="document.getElementById('img1').src='img1on.gif'"
onMouseover="document.getElementById('img1').src='img1off.gif'"><img src="img1off.gif" id="img1" border="0" /></a>
mplungjan You Mean...


<a href="#"
onMouseover="document.getElementById('img1').src='img1on.gif'"
onMouseout="document.getElementById('img1').src='img1off.gif'"><img src="img1off.gif" id="img1" border="0" /></a>


you using mouseover Twice.
Also for xml onmouseover and onmouseout should be lowercase, shouldn't they be?

-r-
Yes, thanks, cut and repeat error
That too :|
Avatar of james130c

ASKER

Hi, i mean when i use the 'name' tag the mouse over works fine, with the 'id' tag i get an error and the link doesn't change when the mouse goes over it.

<a href="#"
onmouseover="changeImages('top_design_04', 'images/top_design_04-over.gif'); return true;"
onmouseout="changeImages('top_design_04', 'images/top_design_04.gif'); return true;">
<img id="top_design_04" src="images/top_design_04.gif" width="99" height="41" alt=""  /></a>

this is the code im using, validates fine, everything is good except that using 'ID' the mouseover doesn't seem to work i get this error.

document is null or not an object.

But as i said using name="top_design_04" works fine but doesn't validate.
Avatar of KennyTM
KennyTM

Hi. Can you show us the source of the function changeImages() ?
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
May I ask why a "B" grade?
If my suggestion worked without even having seen your code, I think an "A" is in order...
Sorry you are right... i have put the wrong grade. How can i change it?