♿ARIA Attributes
Also known as ARIA, Accessible Rich Internet Applications (ARIA), WAI-ARIA, ARIA Roles
Extra labels in the code. They tell screen readers what a part is and does.
Think of it like
It is like sticky notes on a box that say what is inside. The box is unchanged.
Example
A home-made menu button gets one ARIA label. Now a screen reader says Menu, shut. After a press, it says open.
Why it matters
Custom widgets are silent to screen readers without it. With it, they can be described.
Definition
Example code
html
<button aria-expanded="false" aria-controls="menu">Menu</button>
<ul id="menu" hidden>...</ul>Common mistake
Key takeaways
- 1Adds meaning only. Not looks or behaviour.
- 2Real HTML first. The first rule of ARIA.
- 3Wrong is worse than none. Test with a screen reader.