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
Attribute | Description |
accesskey | This can be used to specify a shortcut key for an element. |
class | Classes 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. |
dir | This 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. |
draggable | This attribute indicates whether the element can be dragged. It can have two values - true or false. |
dropzone | This 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. |
hidden | Specifies whether the element is not yet, or is no longer, relevant. This attribute can be used to hide an element from the user temporarly. |
id | The id attribute can be used to specify a unique id for an HTML element. |
lang | Can be used to specify the language of the content of an element. |
spellcheck | Specifies whether the element may be checked for spelling and grammar errors. |
style | This attribute can be used to specify the inline CSS style for an element. |
tabindex | Specifies 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. |
title | Specifies some additional information of an element. Some elements display it as a tooltip. |
translate | Specifies whether the content of an element should be translated when the page is localized. |