HTML Value Syntax

HTML id syntax

A nonempty identifier must be unique within its element tree and contain no ASCII whitespace. IDs are used by fragments, label associations and DOM lookup. Some valid IDs need escaping when used as CSS selectors. This is a value grammar, not a standalone HTML element.

Formal Syntax & Structure

html syntaxhtml
id="account-name"

Working Example

Example Snippethtml
<h2 id="account-name">Account name</h2><a href="#account-name">Jump to account name</a>
HTML Reference