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… |
|---|---|
<div role="button"> | <button> |
<div role="navigation"> | <nav> |
<span role="heading"> | <h2> |
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