Global attribute

Global attributes are attributes that can be used on all elements (though sometimes without effect on some elements).

A few attributes can be used on any HTML element:

  • dir, lang, style, id, class, tabindex, accesskey, title, hidden, data-*, contextmenu, contenteditable, translate, spellcheck, draggable, dropzone, itemid, itemprop, itemref, itemscope, and itemtype.
  • Both xml:lang and xml:base, deprecated, inherited from the XHTML specifications and kept for compatibility purposes.
  • The multiple aria-* attributes, for improving accessibility.
  • The event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting.

Learn more

Document Tags and Contributors

 Contributors to this page: Andrew_Pfeiffer, kscarfone, teoli
 Last updated by: Andrew_Pfeiffer,