Sep 13, 2010

HTML 5 Complete Reference

HTML 5 Tag Reference


HTML 5

HTML 5 improves interoperability and reduces development costs by making precise rules on how to handle all HTML elements, and how to recover from errors.
Some of the new features in HTML 5 are functions for embedding audio, video, graphics, client-side data storage, and interactive documents.
HTML 5 also contains new elements like <nav>, <header>, <footer>, and <figure>.
The HTML 5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and many hundreds
of other vendors.
Note: HTML 5 is not a W3C recommendation yet!
To read about the HTML 5 activities at W3C, visit
W3C tutorial.

Ordered Alphabetically

 New : New tags in HTML 5.
TagDescription
<!--...-->Defines a comment
<!DOCTYPE> Defines the document type
<a>Defines a hyperlink
<abbr>Defines an abbreviation
<acronym>Not supported in HTML 5.
<address>Defines an address element
<applet>Not supported in HTML 5.
<area>Defines an area inside an image map
<article> NewDefines an article
<aside> NewDefines content aside from the page content
<audio> NewDefines sound content
<b>Defines bold text
<base>Defines a base URL for all the links in a page
<basefont>Not supported in HTML 5.
<bdo>Defines the direction of text display
<big>Not supported in HTML 5.
<blockquote>Defines a long quotation
<body>Defines the body element
<br>Inserts a single line break
<button>Defines a push button
<canvas> NewDefines graphics
<caption>Defines a table caption
<center>Not supported in HTML 5.
<cite>Defines a citation
<code>Defines computer code text
<col>Defines attributes for table columns 
<colgroup>Defines groups of table columns
<command> NewDefines a command button
<datalist> NewDefines a dropdown list
<dd>Defines a definition description
<del>Defines deleted text
<details> NewDefines details of an element
<dfn>Defines a definition term
<dir>Not supported in HTML 5.
<div>Defines a section in a document
<dl>Defines a definition list
<dt>Defines a definition term
<em>Defines emphasized text 
<embed> NewDefines external interactive content or plugin
<fieldset>Defines a fieldset
<figcaption> NewDefines the caption of a figure element
<figure> NewDefines a group of media content, and their caption
<font>Not supported in HTML 5.
<footer> NewDefines a footer for a section or page
<form>Defines a form 
<frame>Not supported in HTML 5.
<frameset>Not supported in HTML 5.
<h1> to <h6>Defines header 1 to header 6
<head>Defines information about the document
<header> NewDefines a header for a section or page
<hgroup> NewDefines information about a section in a document
<hr>Defines a horizontal rule
<html>Defines an html document
<i>Defines italic text
<iframe>Defines an inline sub window (frame)
<img>Defines an image
<input>Defines an input field
<ins>Defines inserted text
<keygen> NewDefines a generated key in a form
<kbd>Defines keyboard text
<label>Defines a label for a form control
<legend>Defines a title in a fieldset
<li>Defines a list item
<link>Defines a resource reference
<map>Defines an image map 
<mark> NewDefines marked text
<menu>Defines a menu list
<meta>Defines meta information
<meter> NewDefines measurement within a predefined range
<nav> NewDefines navigation links
<noframes>Not supported in HTML 5.
<noscript>Defines a noscript section
<object>Defines an embedded object
<ol>Defines an ordered list
<optgroup>Defines an option group
<option>Defines an option in a drop-down list
<output> NewDefines some types of output
<p>Defines a paragraph
<param>Defines a parameter for an object
<pre>Defines preformatted text
<progress> NewDefines progress of a task of any kind
<q>Defines a short quotation
<rp> NewUsed in ruby annotations to define what to show browsers that to not support the ruby element.
<rt> NewDefines explanation to ruby annotations.
<ruby> NewDefines ruby annotations.
<s>Not supported in HTML 5.
<samp>Defines sample computer code
<script>Defines a script
<section> NewDefines a section
<select>Defines a selectable list
<small>Defines small text
<source> NewDefines media resources
<span>Defines a section in a document
<strike>Not supported in HTML 5.
<strong>Defines strong text
<style>Defines a style definition
<sub>Defines subscripted text
<summary> NewDefines the header of a "detail" element
<sup>Defines superscripted text
<table>Defines a table
<tbody>Defines a table body
<td>Defines a table cell
<textarea>Defines a text area
<tfoot>Defines a table footer
<th>Defines a table header
<thead>Defines a table header
<time> NewDefines a date/time
<title>Defines the document title
<tr>Defines a table row
<tt>Not supported in HTML 5.
<u>Not supported in HTML 5.
<ul>Defines an unordered list
<var>Defines a variable
<video> NewDefines a video
<xmp>Not supported in HTML 5.

HTML 5 Standard Attributes

The attributes listed below are supported by all HTML
5 tags, with a few exceptions.

HTML 5 Standard Attributes

 New : New standard attributes in HTML 5.
AttributeValueDescription
accesskeycharacterSpecifies a keyboard shortcut to access an element.
classclassnameSpecifies a classname for an element (used to specify a class in
a style sheet).
contenteditable Newtrue

false
Specifies if the user is allowed to edit the content or not.
contextmenu Newmenu_idSpecifies the context menu for an element.
data-yourvalue NewvalueAuthor defined attributes. Authors of a HTML document can
define their own attributes. Must start with "data-".
dirltr
rtl
Specifies the text direction
for the content in an element.
draggable Newtrue
false
auto
Specifies whether or not a user is allowed to drag an element.
hidden NewhiddenSpecifies that the element is not relevant. Hidden elements are
not displayed.
ididSpecifies a unique id for an element.
item Newempty

url
Used to group elements.
itemprop Newurl

group value
Used to group items.
langlanguage_codeSpecifies a language code for the content in an element.
Language code reference
spellcheck Newtrue

false
Specifies if the element must have it's spelling or grammar
checked.
stylestyle_definitionSpecifies an inline style for an element.
subject NewidSpecifies the element's corresponding item.
tabindexnumberSpecifies the tab order of an element.
titletextSpecifies extra information about an element.

Standard Event Attributes

HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.
Below are the standard event attributes that can be inserted into HTML 5 elements to define event actions.
 New : New event attributes in HTML 5.

Window Event Attributes

Events triggered for the window object.
Applies to the <body> tag:
AttributeValueDescription
onafterprint NewscriptScript to be run after the document is printed
onbeforeprint NewscriptScript to be run before the document is printed
onbeforeonload NewscriptScript to be run before the document loads
onblurscriptScript to be run when the window loses focus
onerror NewscriptScript to be run when an error occur
onfocusscriptScript to be run when the window gets focus
onhaschange NewscriptScript to be run when the document has change
onloadscriptScript to be run when the document loads
onmessage NewscriptScript to be run when the message is triggered
onoffline NewscriptScript to be run when the document goes offline
ononline NewscriptScript to be run when the document comes online
onpagehide NewscriptScript to be run when the window is hidden
onpageshow NewscriptScript to be run when the window becomes visible
onpopstate NewscriptScript to be run when the window's history changes
onredo NewscriptScript to be run when the document performs a redo
onresize NewscriptScript to be run when the window is resized
onstorage NewscriptScript to be run when a document loads
onundo NewscriptScript to be run when a document performs an undo
onunload NewscriptScript to be run when the user leaves the document



Form Events

Events triggered by actions inside a HTML form.
Applies to all HTML 5 elements, but is most common in form elements:
AttributeValueDescription
onblurscript Script to be run when an element loses focus
onchangescriptScript to be run when an element changes
oncontextmenu Newscript Script to be run when a context menu is triggered
onfocusscript Script to be run when an element gets focus
onformchange Newscript Script to be run when a form changes
onforminput Newscript Script to be run when a form gets user input
oninput Newscript Script to be run when an element gets user input
oninvalid Newscript Script to be run when an element is invalid
onresetscript Script to be run when a form is reset
Not supported in HTML 5
onselectscript Script to be run when an element is selected
onsubmitscriptScript to be run when a form is submitted



Keybord Events

Events triggered by a keyboard.
Applies to all HTML 5 elements.
AttributeValueDescription
onkeydownscript Script to be run when a key is pressed
onkeypressscript Script to be run when a key is pressed and released
onkeyupscript Script to be run when a key is released



Mouse Events

Events triggered by a mouse, or similar user actions:
Applies to all HTML 5 elements.
AttributeValueDescription
onclickscript Script to be run on a mouse click
ondblclickscript Script to be run on a mouse double-click
ondrag Newscript Script to be run when an element is dragged
ondragend Newscript Script to be run at the end of a drag operation
ondragenter Newscript Script to be run when an element has been dragged to a valid
drop target
ondragleave Newscript Script to be run when an element leaves a valid drop target
ondragover Newscript Script to be run when an element is being dragged over a
valid drop target
ondragstart Newscript Script to be run at the start of a drag operation
ondrop Newscript Script to be run when dragged element is being dropped
onmousedownscript Script to be run when a mouse button is pressed
onmousemovescript Script to be run when the mouse pointer moves
onmouseoutscriptScript to be run when the mouse pointer moves out of an
element
onmouseoverscriptScript to be run when the mouse pointer moves over an
element
onmouseupscript Script to be run when a mouse button is released
onmousewheel Newscript Script to be run when the mouse wheel is being rotated
onscroll Newscript Script to be run when an element's scrollbar is being scrolled



Media Events

Events triggered by medias like videos, images and audio.
Applies to all HTML 5 elements, but is most common in media elements, such as audio, embed, img, object, and video:
AttributeValueDescription
onabortscript Script to be run on an abort event
oncanplay NewscriptScript to be run when media can start play, but might has to
stop for buffering
oncanplaythrough NewscriptScript to be run when media can be played to the end, without
stopping for buffering
ondurationchange Newscript Script to be run when the length of the media is changed
onemptied Newscript Script to be run when a media resource element suddenly becomes
empty (network errors, errors on load etc.)
onended Newscript Script to be run when media has reach the end
onerror Newscript Script to be run when an error occurs during the loading of an
element
onloadeddata NewscriptScript to be run when media data is loaded
onloadedmetadata NewscriptScript to be run when the duration and other media data of a
media element is loaded
onloadstart NewscriptScript to be run when the browser starts to load the media data
onpause Newscript Script to be run when media data is paused
onplay Newscript Script to be run when media data is going to start playing
onplaying Newscript Script to be run when media data has start playing
onprogress Newscript Script to be run when the browser is fetching the media data
onratechange Newscript Script to be run when the media data's playing rate has changed
onreadystatechange Newscript Script to be run when the ready-state changes
onseeked Newscript Script to be run when a media element's seeking attribute is no
longer true, and the seeking has ended
onseeking Newscript Script to be run when a media element's seeking attribute is
true, and the seeking has begun
onstalled Newscript Script to be run when there is an error in fetching media data
(stalled)
onsuspend NewscriptScript to be run when the browser has been fetching media data,
but stopped before the entire media file was fetched
ontimeupdate NewscriptScript to be run when media changes its playing position
onvolumechange NewscriptScript to be run when media changes the volume, also when
volume is set to "mute"
onwaiting NewscriptScript to be run when media has stopped playing, but is
expected to resume