Global Attributes

HTML id attribute

Identifies an element. IDs must be unique in their tree; they support fragment navigation, labels, ARIA references, CSS and DOM lookup. Avoid whitespace and duplicates. Applicability: global HTML attribute, subject to element-specific restrictions and browser support.

Formal Syntax & Structure

html syntaxhtml
id="overview"

Parameters & Attributes

NameTypeDescription
idstring without ASCII whitespaceIdentifies an element. IDs must be unique in their tree; they support fragment navigation, labels, ARIA references, CSS and DOM lookup. Avoid whitespace and duplicates.

Working Example

Example Snippethtml
<h2 id="overview">Overview</h2><a href="#overview">Jump to overview</a>
HTML Reference