How to fix: aria roles missing required attributes
WCAG 2.2 success criterion 4.1.2 (level A)
Why it matters
Assistive technology gets incomplete information about the control.
How to fix
Add the attributes the role needs, for example aria-checked on role="checkbox".
<div role="checkbox" aria-checked="false" tabindex="0">Subscribe</div>
Test it yourself
- Inspect elements with a role and check the required states: role="checkbox" needs aria-checked, role="slider" needs aria-valuenow, and so on.
Common mistakes
- A custom toggle with role="switch" but no aria-checked.
- role="heading" without aria-level.
Check your own site
Find this and other problems on your website in 30 seconds, free.