HTML Global Attributes

Attributes in HTML provides additional meaning about the elements. Global attributes arer those attributes that can be used on any HTML elements.

Attribute Purpose
accesskey Defines a shortcut key.
class Defines single or multiple class names for the element. Class names are used to define styling of the element.
contenteditable Defines whether the content within the element can be edited.
contextmenu Defines a context menu for the element which can be activated by right clicking.
data-* Defines custom data for an element. An element can contain one or more custom data.
dir Defines the direction of text within the element. Direction can be right to left or vice versa.
draggable Defines whether an element can be dragged or not.
dropzone Defines what happens to the dragged data. The dragged data can be copied, moved, linked.
hidden Defines whether the element should be hidden or not. It could be the content within the element is written but is not relevant at the moment.
id Defines a unique identifier for the element.
lang Defines the language of the content for the element.
spellcheck Defines whether the content within the element should be grammar and spellchecked or not.
style Defines the inline styles for an element.
tabindex Defines the tabbing order of an element.
title Defines additional information about the element.
translate Defines whether the content of an element should be translated or not.