HTML Core Atributes
Here's a list of the core attributes that can be used on tags in HTML 5.
If you want to be compatible with earlier versions of HTML, note the items that are NEW or CHANGED at HTML 5.
- accesskey = list of key labels CHANGED
- A key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.
An ordered set of unique space-separated tokens, each of which must be exactly one Unicode code point in length.
- class = set of space-separated tokens
- A name of a classification, or list of names of classifications, to which the element belongs.
- contenteditable = "true" or "false" or "" (empty string) or empty NEW
- Specifies whether the contents of the element are editable.
- contextmenu = ID reference NEW
- The value of the id attribute on the menu with which to associate the element as a context menu.
- dir = "ltr" or "rtl"
- Specifies the element's text directionality.
- draggable = "true" or "false" NEW
- Specifies whether the element is draggable.
- hidden = "hidden" or "" (empty string) or empty NEW
- Specifies that the element represents an element that is not yet, or is no longer, relevant.
- id = ID
- A unique identifier for the element.
There must not be multiple elements in a document that have the same id value.
Any string, with the following restrictions:
* must be at least one character long
* must not contain any space characters
Previous versions of HTML placed greater restrictions on the content of ID values (for example, they did not permit ID values to begin with a number).
- lang = language tag
- Specifies the primary language for the contents of the element and for any of the element's attributes that contain text.
A valid language tag as defined in [BCP 47].
- spellcheck = "true" or "false" or "" (empty string) or empty NEW
- Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.
- style = CSS string
- Specifies zero or more CSS declarations that apply to the element.
- tabindex = integer
- Specifies whether the element represents an element that is is focusable (that is, an element which is part of the sequence of focusable elements in the document), and the relative order of the element in the sequence of focusable elements in the document.
- title = normal character data
- Advisory information associated with the element.