Forum Moderators: open

Message Too Old, No Replies

Question about image swap java script

         

herrjosua

10:27 pm on Feb 18, 2009 (gmt 0)

10+ Year Member



I am trying to validate my website to XHTML Strict standards. The message I am getting is this: 1.0The tag: "img" doesn't have an attribute: "name" in currently active versions.[XHTML 1.0 strict].

How would I convert this to an attribute that is within the the XHTML standard? Here is my code currently? I am think that the tag "id" is going to be used but I do not how to convert my code.


Javascript

var image1a=new Image();

image1a.src='Images/German Maglev/Medium/Germanmaglev_medium_001.jpg';

var image2a=new Image();

image2a.src='Images/German Maglev/Medium/Germanmaglev_medium_002.jpg';


HTML

<img src="Images/German Maglev/Medium/GermanMaglev_medium_001.jpg" name="image" alt="" width="450" height="337"/>

Thanks
Josh

daveVk

11:10 pm on Feb 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try changing name="image" to id="image".

The javascript you show does not refer to "name" so assumably there is some more script that does the actual swapping, you may need some change that as well.