Name
ID — NN 3 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. Browsers
typically allow the ID attribute to be used as a
substitute for the NAME attribute to make the
element an anchor. In this case, one ID attribute
can serve double duty as a style sheet rule selector and anchor name.
An A element can have an ID assigned for
uniqueness as well as a class for inclusion within a group.
Example
<A ID="section3">Section 3</A>
Value
Case-sensitive identifier.
Default
None.
Object Model Reference
- IE
[window.]document.links[i].id
[window.]document.anchors[i].id
[window.]document.all.elementID.id
- NN
[window.]document.anchors[i].name
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