Loading…
Sometimes plain HTML elements do not fully convey meaning to assistive technologies. ARIA (Accessible Rich Internet Applications) is a set of attributes that fill these gaps.
No ARIA is better than bad ARIA.
Always prefer native HTML elements first. Use ARIA only when no HTML element can express the meaning you need.
| Instead of… | Use… |
|---|---|
| <code><div role="button"></code> | <code><button></code> |
| <code><div role="navigation"></code> | <code><nav></code> |
| <code><span role="heading"></code> | <code><h2></code> |
role<div role="alert">Your form has been submitted!</div>
aria-label<button aria-label="Close dialog">✕</button>
aria-hidden<span aria-hidden="true">🎨</span>
aria-describedby<input type="password" id="pw" aria-describedby="pw-hint">
<small id="pw-hint">Must be at least 8 characters.</small>
Create a page that demonstrates ARIA attributes:
<header> with role="banner"<input> with aria-label="Search the site"aria-label="Close"aria-hidden="true"aria-describedby