HTML5 introduces a number of APIs that help in creating Web applications. These can be used together with the new elements introduced for applications:
- API for playing of video and audio which can be used with the new
videoandaudioelements. - An API that enables offline Web applications.
- An API that allows a Web application to register itself for certain protocols or media types.
- Editing API in combination with a new global
contenteditableattribute. - Drag & drop API in combination with a
draggableattribute. - API that exposes the history and allows pages to add to it to prevent breaking the back button.
Extensions to HTMLDocument
HTML5 has extended theHTMLDocumentinterface from DOM Level 2 HTML in a number of ways. The interface is now implemented on all objects implementing theDocumentinterface so it stays meaningful in a compound document context. It also has several noteworthy new members: -
getElementsByClassName()to select elements by their class name. The way this method is defined will allow it to work for any content withclassattributes and aDocumentobject such as SVG and MathML. -
innerHTMLas an easy way to parse and serialize an HTML or XML document. This attribute was previously only available onHTMLElementin Web browsers and not part of any standard. -
activeElementandhasFocusto determine which element is currently focused and whether theDocumenthas focus respectively. -
getSelection()which returns an object that represents the current selection(s).Extensions to
TheHTMLElementHTMLElementinterface has also gained several extensions in HTML5: -
getElementsByClassName()which is basically a scoped version of the one found onHTMLDocument. -
innerHTMLas found in Web browsers today. It is also defined to work in XML context (when it is used in an XML document). -
classListis a convenient accessor forclassName. The object it returns, exposes methods (contains(),add(),remove(), andtoggle()) for manipulating the element's classes. Thea,areaandlinkelements have a similar attribute calledrelListthat provides the same functionality for therelattribute.
Source : http://www.w3.org/