ARIA & Accessible HTML in HTML

From the HTML cheat sheet ยท Accessibility ยท verified Jul 2026

ARIA & Accessible HTML

Essential ARIA attributes and semantic patterns for accessible web pages

html
<!-- Label elements properly -->
<label for="email">Email:</label>
<input type="email" id="email" aria-required="true">

<!-- Describe with ARIA -->
<button aria-label="Close dialog">ร—</button>

<!-- Hide decorative content -->
<img src="divider.png" alt="" aria-hidden="true">

<!-- Live regions for dynamic updates -->
<div role="alert">Form submitted successfully!</div>
๐Ÿ’ก The best ARIA is no ARIA โ€” use semantic HTML elements first (button, nav, main, label)
โšก aria-label is for elements with no visible text; aria-labelledby points to existing text
๐Ÿ“Œ Always use alt="" (empty) for decorative images โ€” missing alt is an accessibility violation
๐ŸŸข aria-live="polite" announces changes without interrupting; "assertive" interrupts immediately
ariaaccessibilitya11y

More HTML tasks

Back to the full HTML cheat sheet