Name
ID — NN 4 IE 3 HTML 4
Synopsis
ID=”elementIdentifier"Optional
A unique identifier that distinguishes this element from all the rest in the document. Can be used to associate a single element with a style rule naming this attribute value as an ID selector. An element can have an ID assigned for uniqueness as well as a class for inclusion within a group. See Chapter 3.
If you assign an ID attribute and not a
NAME attribute, the value of the
ID attribute cannot be used reliably as the
IMG element’s name in script reference forms
that use the element name. Some browser platforms insist on the
NAME attribute being used in an image name
reference.
Example
<IMG SRC="desk3.gif" ID="desk3" HEIGHT=90 WIDTH=120>
Value
Case-sensitive identifier.
Default
None.
Object Model Reference
- IE
[window.]document.
imageName.id[window.]document.images[i].id
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access