Global

HTML global attributes are attributes that can be used with any HTML element, no matter the element's type. These attributes enhance the functionality of elements, contributing to better accessibility, styling, interactivity, and overall user experience.

HTML Global Attributes

Global attributes can be used with all HTML elements.

AttributeDescription
accesskeyDefines a shortcut key to activate or focus on an element.
classAssigns one or more class names to an element, linking it to a stylesheet.
contenteditableDetermines if an element's content can be edited.
data-*Stores custom data specific to the page or application.
dirDefines the text direction within an element.
draggableIndicates whether an element can be dragged.
enterkeyhintSets the label for the enter key on a virtual keyboard.
hiddenSpecifies that an element is currently not relevant or visible.
idAssigns a unique identifier to an element.
inertIndicates that an element should be ignored by user interaction.
inputmodeDefines the expected input type for a virtual keyboard.
langSpecifies the language of the element's content.
popoverDefines an element as a popover.
spellcheckDetermines whether spelling and grammar checking should be enabled.
styleApplies inline CSS styles to an element.
tabindexSets the tabbing order for navigating elements.
titleProvides additional information about an element.
translateSpecifies whether an element’s content should be translated.