Add Site or Add Page to Favorites
 

 HTML 5 Atttribute Reference 

HTML 5 Attributes in General

HTML Best Practices for Attributes

Boolean HTML Attributes

Using the full form (attribute="attribute") of boolean attributes rather than the minimized form is recommended. The full form will be properly understood by web browsers parsing polyglot documents as either the HTML syntax or the XML syntax of HTML 5.

<input type="text" readonly="readonly"/>
<input type="text" required="required"/>
<option selected="selected"/>
<video autoplay="autoplay" ...>

Converting to HTML 5

We are working on converting to HTML 5. Please visit HTML Attributes on the HTML 5 standard version of this site.

Common HTML 5 Attributes

List of HTML attributes that can be coded on any tag

These are the common (global) attributes that can be used on various HTML tags.

html-attributes
The class Attribute
The contenteditable Attribute
The contextmenu Attribute
The Author-Defined data-* Attributes
The dir Attribute
The draggable Attribute
The hidden Attribute
The id Attribute
The item Attribute
The lang Attribute
The spellcheck Attribute
The style Attribute
The tabindex Attribute
The title Attribute
The <on...> Event Attributes
XML Atttributes in HTML
The class Attribute

The class HTML attribute

The class attribute

Examples

<p class="centered">Alignment of this paragraph will be
determined by the settings of the ".center" style.</p>

Google Translate class attribute

Although it is a misuse of the class attribute, Google Translate recognizes the specific value notranslate, indicating that the content of the element should not be translated into other spoken languages. http://www.Google.com/help/faq_translation.html#donttrans

Examples

<span class="notranslate">...</span>
The contenteditable Attribute

The contenteditable HTML attribute

The contenteditable attribute

Examples

<span contenteditable="">...</span>
The contextmenu Attribute

The contextmenu HTML attribute

The contextmenu attribute

Examples

<span contextmenu="">...</span>
The Author-Defined data-* Attributes

The author-defined <data-*> attributes

Examples

<span data-latitude="40°19'N" data-longitude="79°59'35"W">...</span>
The dir Attribute

The dir HTML attribute

The dir attribute

Examples

<span dir="">...</span>
The draggable Attribute

The draggable HTML attribute

The draggable attribute

Examples

<span draggable="">...</span>
The hidden Attribute

The hidden HTML attribute

The hidden attribute

Examples

<span hidden="">...</span>
The id Attribute

The id HTML attribute

The id attribute

Examples

<span id="mytag">...</span>
The item Attribute

The item HTML attribute

The item attribute is used for "microdata", which can be machine-readable.

More information: item attribute

The lang Attribute

The lang HTML attribute

The lang attribute

Examples

<span lang="">...</span>
The spellcheck Attribute

The spellcheck HTML attribute

The spellcheck attribute

Examples

<span spellcheck="">...</span>
The style Attribute

The style HTML attribute

The style attribute

Examples

<span style="">...</span>
The tabindex Attribute

The tabindex HTML attribute

The tabindex attribute

Examples

<span tabindex="">...</span>
The title Attribute

The title HTML attribute

The title attribute

Line breaks within the title attribute in the source code are significant and will be included if the title is displayed.

Examples

<span title="">...</span>
The <on...> Event Attributes

The <on...> Event attributes

The list of the event attributes include:

onabort
The onabort attribute
onbeforeonload
The onbeforeonload attribute
onbeforeunload
The onbeforeunload attribute
onblur
The onblur attribute
oncanplay
The oncanplay attribute
oncanplaythrough
The oncanplaythrough attribute
onchange
The onchange attribute
onclick
The onclick attribute
oncontextmenu
The oncontextmenu attribute
oncopy
The oncopy attribute
oncut
The oncut attribute
ondblclick
The ondblclick attribute
ondrag
The ondrag attribute
ondragend
The ondragend attribute
ondragenter
The ondragenter attribute
ondragleave
The ondragleave attribute
ondragover
The ondragover attribute
ondragstart
The ondragstart attribute
ondrop
The ondrop attribute
ondurationchange
The ondurationchange attribute
onemptied
The onemptied attribute
onended
The onended attribute
onerror

On the body tag, the onerror attribute is a property of the document's window object. On other elements, the onerror attribute is a property of the HTML element itself.

onfocus
The onfocus attribute
onformchange
The onformchange attribute
onforminput
The onforminput attribute
ongesturechange
The ongesturechange attribute
ongestureend
The ongestureend attribute
ongesturestart
The ongesturestart attribute
oninput
The oninput attribute
onkeydown
The onkeydown attribute
onkeypress
The onkeypress attribute
onkeyup
The onkeyup attribute
onload

On the body tag, the onload attribute is a property of the document's window object. On other elements, the onload attribute is a property of the HTML element itself.

onloadeddata
The onloadeddata attribute
onloadedmetadata
The onloadedmetadata attribute
onloadstart
The onloadstart attribute
onmousedown
The onmousedown attribute
onmousemove
The onmousemove attribute
onmouseout
The onmouseout attribute
onmouseover
The onmouseover attribute
onmouseup
The onmouseup attribute
onmousewheel
The onmousewheel attribute
onmove
The onmove attribute
onorientationchange
The onorientationchange attribute
onpaste
The onpaste attribute
onpause
The onpause attribute
onplay
The onplay attribute
onplaying
The onplaying attribute
onprogress
The onprogress attribute
onratechange
The onratechange attribute
onreadystatechange
The onreadystatechange attribute
onreset
The onreset attribute has been deprecated in HTML 5 and should not be used.
onresize
The onresize attribute
onscroll
The onscroll attribute
onseek
The onseek attribute
onseeking
The onseeking attribute
onselect
The onselect attribute
onshow
The onshow attribute
onstalled
The onstalled attribute
onsubmit
The onsubmit attribute
onsuspend
The onsuspend attribute
ontimeupdate
The ontimeupdate attribute
ontouchcancel
The ontouchcancel attribute
ontouchend
The ontouchend attribute
ontouchmove
The ontouchmove attribute
ontouchstart
The ontouchstart attribute
onunload
The onunload attribute
onvolumechange
The onvolumechange attribute
onwaiting
The onwaiting attribute

Examples

<span onclick="">...</span>

Last updated Sunday September 19, 2010

You are currently viewing this page in HTML 5 XML* format (* see Clicklets for more infomation). This document is also available in XML* HTML 5 non-XML*XHTML 1 Style Sheet*HTML 5 Style Sheet* XHTML 1* HTML 4* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.


Copyright © 2010 Accilent® Corp. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.

DISCLAIMER: All information, links, forms, applications and other items on this site or obtained from it are provided AS IS, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.