Global attribute

翻译不完整。 请帮助我们翻译这篇文章!

全局属性是指在所所有元素之上均可被访问的属性 .(虽然有时候某些属性对某种元素没有具体的影响)


以下是一部分可以被用于所有 HTML 元素的属性:

  • 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