|
The id Attribute Replaces The name Attribute |
|
HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead. This is wrong: <img src="picture.gif" name="picture1" /> | This is correct: <img src="picture.gif" id="picture1" /> | Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values, like this: <img src="picture.gif" id="picture1" name="picture1" /> | IMPORTANT Compatibility Note: To make your XHTML compatible with today's browsers, you should add an extra space before the "/" symbol.
|