HTML attributes give elements meaning and context.

The attributes listed here are common to all HTML5 elements.

Attribute Definition
accesskey Specifies a shortcut key that can be used to access the element.
class Used to refer to a class specified in the style sheet. The value should be the name of the class you wish to use.
contenteditable Sets whether the user can edit the content or not.
contextmenu Specifies a context menu for an element. The context menu appears when a user right-clicks on the element.
data-* Used to store custom data private to the page or application.
dir Specifies the text direction for the content in an element.
Possible Values:
  • ltr - Specifies that the text should read left to right.
  • rtl - Specifies that the text should read right to left.
  • auto - Specifies that the text direction should be determined programatically using the contents of the element.
draggable Specifies whether the user is allowed to drag the element or not.
Possible Values:
  • true - Specifies that the element is draggable.
  • false - Specifies that the element is not draggable.
  • auto - Uses the default behavior of the user agent/browser. This is the default value.
dropzone Specifies whether the dragged data is copied, moved, or linked, when dropped.
hidden Indicates that the element is not yet, or is no longer, relevant. The browser/user agent does not display elements that have the hidden attribute present.
id Specifies a unique id for an element.
lang Specifies the language of the element's content.
spellcheck Specifies whether the element should have its spelling checked.
style Specifies inline styles for the element. The value should be the style definition you wish to use.
tabindex Helps determine the tabbing order (when the user 'tabs' through the elements on the page).
title Specifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
translate Specifies whether the content of an element should be be translated or not.