Expand description
Attribute names for global HTML attributes.
§Purpose
Global attributes can be used on any HTML element, providing common functionality like styling, identification, accessibility, and interaction control across all elements.
§Common Attributes
class: Space-separated CSS class names for stylingid: Unique identifier for the elementstyle: Inline CSS stylestitle: Advisory information (tooltip text)lang: Language of the element’s contentdir: Text directionality (ltr, rtl, auto)tabindex: Tab order for keyboard navigationhidden: Hides element from renderingcontenteditable: Makes element content editabledraggable: Enables drag-and-droprole: ARIA role for accessibility
§Example
<div class="container" id="main" lang="en" dir="ltr">
<p class="text" title="Helpful tooltip" tabindex="0">Content</p>
<span role="button" draggable="true">Drag me</span>
</div>§WHATWG Specification
Constants§
- ACCESSKEY
- The
accesskeyattribute. - CLASS
- The
classattribute. - CONTENTEDITABLE
- The
contenteditableattribute. - DIR
- The
dirattribute. - DRAGGABLE
- The
draggableattribute. - HIDDEN
- The
hiddenattribute. - ID
- The
idattribute. - LANG
- The
langattribute. - ROLE
- The
roleattribute. - SLOT
- The
slotattribute. - SPELLCHECK
- The
spellcheckattribute. - STYLE
- The
styleattribute. - TABINDEX
- The
tabindexattribute. - TITLE
- The
titleattribute. - TRANSLATE
- The
translateattribute.