HTML5 Global Attributes

Last Updated:

HTML5 Global Attributes

HTML5 global attributes are common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.

The following table provides a list of all HTML5 Global Attributes.

AttributeValueExplanation
accesskey character Specifies a keyboard shortcut for the current element
class name Specifies grouping of any element.
contenteditable bool Specifies whether the content of the element is editable.
data-* name Specifies a custom attribute, it is used for grouping elements within its parent element.
dir
  • ltr
  • rtl
  • auto
Specifies the text direction for the content in an element.
draggable bool Specifies whether an element is draggable.
hidden - Specifies that the element will not be visible.
id name Specifies a unique id for an element.
lang language_code Specifies the language of an element.
spellcheck bool Specifies whether the content of the element have to check spelling.
style CSS Properties Specifies an inline CSS style for an element.
tabindex number Specifies the tabbing order of an element
title text Specifies addition information about an element

HTML5 Deprecated Global Attributes

The following table provides a list of all HTML5 Deprecated Global Attributes.

Note: These attributes should not be used in your webpages in any case.

AttributeValueExplanation
autocapitalize
  • off or none
  • on or sentences
  • words
  • characters
Specifies whether and how text input is automatically capitalized.
contextmenu ID Specifies the id of a <menu> to use as the contextual menu for this element.
dropzone
  • copy
  • move
  • link
Specifies whether dragged and dropped data should be copy, move or link.
translate bool Specifies whether to translate an element when the page is localized.

Share this Page

Meet the Author