Forum Moderators: open

Message Too Old, No Replies

deprecated "name" attribute for "img" tag

Validation kicks out "name" attribute

         

Jose52

4:36 am on Oct 9, 2003 (gmt 0)

10+ Year Member



Does anybody have a good work around when the "name" attribute in an "image tag" is needed to execute javascript, but it is kicked out when I validate for "strict" xhtml. I tried to replace it with "id", but then the javascript doesn't work.

Jeff_H

4:43 am on Oct 9, 2003 (gmt 0)

10+ Year Member



I bet that using the "id" tag is the best way to replace it, since when using javascript you can manipulate by id just as well as by name. This is simply something I surmise, so I'd suggest waiting for some more definitive answers.

garann

5:29 pm on Oct 9, 2003 (gmt 0)

10+ Year Member



Just a guess about what you're doing: If your JavaScript references that element like

document.all.imageElementName.src = ...

you can change it to

document.getElementById("imageElementName").src = ...

and it ought to work, as Jeff_H says.