我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
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
- The HTML global attributes.