- Erik Kroes describes his accessible toggle switch, which makes use of a
aria-checked="true"attributes. He chose
<button>because “I want something to change instantly which a checkbox really should not be doing. In my experience, checkboxes that change things often clash with WCAG Criterion 3.2.1: On Focus. A aligns better with the goal of instant change”. It’s always interesting to see how different devs approach this problem.
Did you know that you can subscribe to dai11y, week11y, fortnight11y or month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.