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
video
andaudio
elements. - 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
contenteditable
attribute. - Drag & drop API in combination with a
draggable
attribute. - API that exposes the history and allows pages to add to it to prevent breaking the back button.
Extensions to HTMLDocument
HTML5 has extended theHTMLDocument
interface from DOM Level 2 HTML in a number of ways. The interface is now implemented on all objects implementing theDocument
interface 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 withclass
attributes and aDocument
object such as SVG and MathML. -
innerHTML
as an easy way to parse and serialize an HTML or XML document. This attribute was previously only available onHTMLElement
in Web browsers and not part of any standard. -
activeElement
andhasFocus
to determine which element is currently focused and whether theDocument
has focus respectively. -
getSelection()
which returns an object that represents the current selection(s).Extensions to
TheHTMLElement
HTMLElement
interface has also gained several extensions in HTML5: -
getElementsByClassName()
which is basically a scoped version of the one found onHTMLDocument
. -
innerHTML
as found in Web browsers today. It is also defined to work in XML context (when it is used in an XML document). -
classList
is a convenient accessor forclassName
. The object it returns, exposes methods (contains()
,add()
,remove()
, andtoggle()
) for manipulating the element's classes. Thea
,area
andlink
elements have a similar attribute calledrelList
that provides the same functionality for therel
attribute.
Source : http://www.w3.org/
No comments:
Post a Comment