Accessible Checkboxes
This page shows different ways a checkbox can be marked up to see how screen readers will describe them to users.
A real styled HTML5 checkbox
<div>
tags.
Code Walkthrough of the Above Example
Below is the HTML of the above example. Use the dropdown to highlight each of the individual steps that makes the example accessible.
A DIV with a role of checkbox
If you come across a <div>
in existing code that is marked up like a checkbox,
you can fix it this way. It is preferable to use the HTML5 version instead, if you can implement
it quickly.
Code Walkthrough of the Above Example
Below is the HTML of the above example. Use the dropdown to highlight each of the individual steps that makes the example accessible.
HTML checkbox group
If you have a group of checkboxes, this is the proper way to style them. Instead of fieldsets,
you could use <role="group">
, which is described in the
ARIA form role example.
Code Walkthrough of the Above Example
Below is the HTML of the above example. Use the dropdown to highlight each of the individual steps that makes the example accessible.