Accessibility
- The checkbox has role
checkbox
. - The checkbox has an accessible label provided by one of the following:
- Visible text content contained within the element with role
checkbox
. - A visible label referenced by the value of
aria-labelledby
set on the element with rolecheckbox
. aria-label
set on the element with rolecheckbox
.
- Visible text content contained within the element with role
- When checked, the checkbox element has state
aria-checked
set totrue
. When not checked, it has statearia-checked
set tofalse
. When partially checked, it has statearia-checked
set tomixed
. - If a set of checkboxes is presented as a logical group with a visible label, the checkboxes are included in an element with role
group
that has the propertyaria-labelledby
set to the ID of the element containing the label. - If the presentation includes additional descriptive static text relevant to a checkbox or checkbox group, the checkbox or checkbox group has the property
aria-describedby
set to the ID of the element containing the description. - Use
fieldset
to create a checkbox group. - When the checkbox has focus, pressing the “Space” key changes the state of the checkbox.
Was this page helpful?
Thanks for your feedback!