On this page
Global Attributes
Prev: attributes | Up: attributes | Next: Form & Validation Attributes
Rel: Attribute Selectors, Nodes & Elements
Ref: MDN Web Docs — Global Attributes
Tags: #public #web #html #attributes
Contents
Identity, Styling & Custom Data
id: Document-unique identifier used for fragment links (#section),<label for="...">, andaria-labelledby.class: Space-separated styling hooks targeted by CSS.classselectors.data-*: Custom attributes exposed in JavaScript viaelement.dataset(camelCased:data-user-id->el.dataset.userId).lang&dir: Language and text direction (ltr,rtl,auto) for screen readers and hyphenation.
<article id="post-42" class="card featured" data-author-id="7" lang="en">
<h2>Global Attributes</h2>
</article>
Visibility, Focus & Interactivity
hidden: Removes element from rendering (hidden="until-found"allows in-page find to reveal collapsed sections).tabindex:0adds an element to natural tab order;-1makes it programmatically focusable (el.focus()) without adding it to tab order. Avoid positive values (tabindex="1").inert: Makes an entire subtree non-focusable, non-clickable, and hidden from assistive tech (ideal for background content behind custom drawers).popover: Turns any element into a top-layer popover toggled viapopovertarget="id"with built-in light dismiss.
Linked from
Related notes
- tuts/html/attributes Linked here; links to this page; shared tags: #attributes, #html, #web
- tuts/html/attributes/form_and_validation_attributes Linked here; links to this page; shared tags: #attributes, #html, #web
- tuts/css/selectors/basic_and_combinator_selectors Linked here; links to this page; shared tags: #web
- tuts/html/tutorials/native_interactive_patterns links to this page; shared tags: #html, #web
- tuts/css links to this page; shared tags: #web
- tuts/css/selectors links to this page; shared tags: #web
- tuts/web/dom/nodes_and_elements Linked here; shared tags: #web
- tuts/html/attributes/aria_and_accessibility_attributes shared tags: #attributes, #html, #web
- tuts/html shared tags: #html, #web
- tuts/html/elements shared tags: #html, #web