How to fix: toggles and checkboxes without a name
WCAG 2.2 success criterion 4.1.2 (level A)
Why it matters
Users hear "checkbox" or "switch" but not what it controls.
How to fix
Give each role="checkbox", "switch" or "radio" a visible text or aria-label.
<div role="switch" aria-checked="false" tabindex="0">Newsletter</div>
Test it yourself
- Tab to custom checkboxes, switches and radio buttons (role="checkbox", "switch", "radio") and listen: the screen reader should say what each one turns on.
Common mistakes
- A cookie or newsletter switch with the text next to it but not connected to it.
- A styled checkbox where the real input is hidden and the label points elsewhere.
Check your own site
Find this and other problems on your website in 30 seconds, free.