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.

Attribute HTML5 Description
accesskey Specifies a shortcut key for an element to be used in place of keyboard.
class The class of the element.
contenteditable Yes Boolean attribute to specify whether the element is editable or not.
contextmenu Yes Specifies a context menu for an element.
data-* Yes Used to store custom data associated with the element.
draggable Yes Boolean attribute to specify whether the element can be dragged or not.
dropzone Yes Specifies whether the dragged data is copied, moved, or linked when dropped.
hidden Yes Specifies whether the element should be visible or not.
id Yes A unique id for the element.
spellcheck Yes Specifies if the element must have its spelling or grammar checked.
style An inline style definition.
tabindex Specifies the tab order of an element.
title The text to display in a tooltip.
translate Yes The 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.

Attribute Value Description
dir ltr | rtl Sets the text direction.
lang language_code Sets the language code.