HTML – Attributes Reference

These are the HTML attributes that are standard and associated with all the visual HTML tags. These attributes are listed with a brief description.

Global HTML Attributes

These attributes are not valid in the base, head, HTML, meta, param, script, style, and title elements.

accesskeySpecifies a shortcut key for an element to be used in place of keyboard.
classThe class of the element.
contenteditableYesBoolean attribute to specify whether the element is editable or not.
contextmenuYesSpecifies a context menu for an element.
data-*YesUsed to store custom data associated with the element.
draggableYesBoolean attribute to specify whether the element can be dragged or not.
dropzoneYesSpecifies whether the dragged data is copied, moved, or linked when dropped.
hiddenYesSpecifies whether the element should be visible or not.
idYesA unique id for the element.
spellcheckYesSpecifies if the element must have its spelling or grammar checked.
styleAn inline style definition.
tabindexSpecifies the tab order of an element.
titleThe text to display in a tooltip.
translateYesThe boolean attribute specifies whether the content of an element should be translated or not.

Language Attributes

The lang attribute indicates the language being used for the enclosed content. The language is identified using the ISO RFC 1766 standard language abbreviations as described in the standard.

These attributes are not valid in the base, br, frame, frameset, hr, iframe, param, and script elements.

dirltr | rtlSets the text direction.
langlanguage_codeSets the language code.