WAI-ARIA Attributes Explained: Roles, States & Properties
Bad ARIA is worse than no ARIA. Learn when to reach for WAI-ARIA attributes and how to pair them with real keyboard state updates.
Key Takeaways
- First Rule of ARIA: Prefer native HTML elements whenever available.
- ARIA attributes only update the accessibility tree—they do not add keyboard event listeners or visual styles.
- Always verify aria-labelledby and aria-describedby IDs exist in the DOM.
Essential State Attributes
Interactive disclosures, tabs, and toggles rely on live state attributes like aria-expanded, aria-selected, aria-pressed, and aria-invalid that update dynamically via JavaScript.
Disclosure button with aria-expanded
<button type="button" aria-expanded="false" aria-controls="faq-1">Shipping details</button>
<div id="faq-1" hidden>Ships in 2 business days.</div>Frequently Asked Questions
Interactive Tools for This Guide
ARIA Attribute Checker
Validate aria-* spelling, WAI-ARIA 1.2 compliance, and broken ID references.
Accessible Accordion Generator
Generate accessible accordions with heading-wrapped buttons and aria-expanded.
Continue Reading
Accessible Name Computation (AccName): How Screen Readers Name Controls
Learn how browsers compute every element's accessible name and why visible text must match aria-label.
ARIA Live Regions Guide: Polite vs. Assertive Status Announcements
Announce toast confirmations, search result counts, and form errors reliably across screen readers.