HTML global attributes
HTML

HTML global attributes

Mishel Shaji
Mishel Shaji

Attributes that are common to all HTML elements are known as Global attributes. Global attributes may be specified on all HTML elements, even those not specified in the standard.

Common HTML Global attributes

AttributeDescription
accesskeyThis can be used to specify a shortcut key for an element.
classClasses can be added to an element to allow CSS and javascript to select specific elements using class selectors.
data-*This attribute can be used to specify custom data for the application. This data may be used by the scripts.
dirThis can be used to specify the direction on the element's text. It can have the following values:
->ltr - Left to right.
->rtl - right to left.
->auto - User agent decides the direction of the text.
draggableThis attribute indicates whether the element can be dragged. It can have two values - true or false.
dropzoneThis attribute indicates whether the dragged data should be copied, moved or linked when dropped. It can have the following values:
->copy - A copy of the dragged element will agent when dropped.
->move - The dragged element will be moved to another location.
->link - A link to the dragged item will be created.
hiddenSpecifies whether the element is not yet, or is no longer, relevant. This attribute can be used to hide an element from the user temporarly.
idThe id attribute can be used to specify a unique id for an HTML element.
langCan be used to specify the language of the content of an element.
spellcheckSpecifies whether the element may be checked for spelling and grammar errors.
styleThis attribute can be used to specify the inline CSS style for an element.
tabindexSpecifies the tabbing order of the element. It can have the following values:
->Negative value - Indicates that the element is focusable, but not be focusable via keyboard navigation.
->0 - Indicates that the element is focusable using the keyboard.
->Positive value - Indicates that the element is focusable using keyboard navigation in the specified order.
titleSpecifies some additional information of an element. Some elements display it as a tooltip.
translateSpecifies whether the content of an element should be translated when the page is localized.