QuizNot attempted
A custom toggle switch
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
role="switch"witharia-checkedkept in sync, plus a visible oraria-labelname
role="switch"announces an on/off control,aria-checkedmust reflect the current state, and it needs a name- building it on a real
<button>gives focus and Enter/Space for free. - Not aria-pressed on a div without tabindex: can't be reached by keyboard.
- Not colour alone: invisible to screen readers and fails users with colour-vision deficiencies.
- Not role=checkbox on a span with click: not focusable and no keyboard activation.