HTML attribute: Difference between revisions

Content deleted Content added
Yobot (talk | contribs)
m WP:CHECKWIKI error fixes using AWB (10823)
Standard attributes: added details
Line 126:
==Standard attributes==
 
''Standard attributes'' are also known as ''global attributes'', and canfunction be used inwith a large number of element classeselements.<ref name="globalattribute">{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes |title=Global attributes - HTML (HyperText Markup Language) MDN |date=|accessdate=2015-02-12}}</ref> They include the basic standard attributes: these include ''accesskey, class, contenteditable, contextmenu, data, dir, hidden, id, lang, style, tabindex, title, translate''. There are also some experimental ones. Both ''xml:lang'' and ''xml:base'' have been deprecated. The multiple ''aria-*'' attributes improve accessibility.<ref name="globalattribute"/> The event handler attributes are listed later on.
 
Technically all standard attributes must be accepted by all elements, though they will not function with some element classeselements.<ref name="HTMLReference">{{cite web | url=https://developer.mozilla.org/en-US/docs/Web/HTML/Reference | title=HTML reference - HTML (HyperText Markup Language) MDN | accessdate=13 February 2015}}</ref> The table below lists some common standard attributes, and some tags they can function with.
 
{| class="wikitable sortable"
!Tag
!id
!Attribute
!class
!Attribute
!style
!Attribute
!title
!Attribute
!dir
!Attribute
!lang
!Attribute
!xml:lang
!Attribute
!accesskey
!Attribute
!tabindex
!Attribute
|-
!{{MDNHTMLRef|param}}
Line 1,047:
===Event attributes===
 
The standard attributes include the ''event handler attributes''. They are all prefixed on-. They are: ''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.''<ref name="globalattribute"/>
 
Event attributes, added in HTML version 4, allow an element to specify scripts to be run under specific circumstances. The table below lists some common event handler attributes, and some tags they can function with.
 
{| class="wikitable sortable" style="font-size:80%;"