aria-* attributes must be allowed for the element’s role
Rule
aria-allowed-attr· ARIA · impact serious · Static + live
Why it matters
Each role supports a specific set of states and properties. Applying an unsupported one (e.g. aria-checked on a link) produces undefined behaviour and may be ignored or mis-announced.
How to fix
Use only the global ARIA attributes plus those supported by the element’s role; pick a role that actually supports the state you need.
Example
<a href="/x" role="link" aria-checked="true">x</a>
<a href="/x" role="link">x</a>
WCAG success criteria
4.1.2 Name, Role, Value — Level A
Every UI component must expose a correct name, role, and (where relevant) state/value to assistive technology.
Standards
This rule contributes to the following standards:
WCAG A EN 301 549
| Standard | Criteria |
|---|---|
| EN 301 549 | 9.4.1.2 |