A checkbox element is missing required aria attributes
| Field | Value |
|---|---|
| Rule code | Checkbox_AttributeRequirement_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 4.1.2 Name, Role, Value |
| Must be fixed at source | No |
Description
Checkboxes must include specific ARIA attributes to be fully accessible to assistive technologies. These elements should have 'aria-checked' to reference the checked status of the checkbox. In elements that leverage the input[type=checkbox], a [checked] attribute is required. Missing any of these attributes can lead to incomplete or incorrect interpretation of the checkbox state by screen readers. Ensure all required ARIA attributes are present for checkbox elements. More details on ARIA role requirements are available here: https://www.w3.org/TR/wai-aria-1.1/#checkbox.
How to fix
To resolve this issue, ensure that each input[type=checkbox] or element that functions as a checkbox, has a state of checked. For input[type=checkbox], a [checked] attribute suffices. For non input elements that act as checkboxes, you can provide an [aria-checked=true] or [aria-checked=false] attribute. These attributes are essential for conveying the checkboxes' states and content, allowing screen readers to interpret them correctly.