HTML and CSS Reference
In-Depth Information
Using
HTML5
, you can cut down on the amount of markup required to
provide an accessible user experience. This listing updates the previous
one but takes advantage of the strong and implied native semantics in
place of several of the
ARIA
attributes:
<body>
<aside aria-live="polite" aria-relevant="additions removals">
An update added by JavaScript
</aside>
<header role="banner">
<h1>The heading</h1>
</header>
<nav>
<a href="/home">Home Page</a>
<a href="/inbox">Inbox</a>
</nav>
<article role="main">
A very interesting article goes here.
</article>
<footer>
All rights reserved.
</footer>
</body>
Although you don't have to use the implied ARIA roles on
elements with strong semantics, such as
<link>
and
<nav>
, at
present no assistive technologies recognize the HTML5
elements. You should specify both for backward compatibility.
Extending HTML with custom attributes
Custom data attributes allow authors to add arbitrary data to elements
for their own private use. The idea is that some data isn't directly rele-
vant to the user but does have meaning to the JavaScript on the page
that can't be expressed in
HTML
semantics. It's a standardization of an
approach taken by several JavaScript widget libraries, such as Dijit
(the Dojo toolkit). These libraries, like
HTML5
, set out to enhance and
extend the application abilities of
HTML4
—adding things such as
combo boxes and date pickers, which
HTML5
also provides, but also
more complex
UI
elements such as tree views, drop-down menus, and