Description
Indicates the current “checked” state of checkboxes, radio buttons, and other widgets. See related aria-pressed and aria-selected.
The aria-checked attribute indicates whether the element is checked (true), unchecked (false), or represents a group of other elements that have a mixture of checked and unchecked values (mixed). Most inputs only support values of true and false, but the mixed value is supported by certain tri-state inputs such as a checkbox or menuitemcheckbox.
The mixed value is not supported on radio, menuitemradio, switch or any element that inherits from these in the taxonomy, and user agents MUST treat a mixed value as equivalent to false for those roles.
Example
HTML Example
<span role="checkbox"
aria-checked="true"
tabindex="0"
id="simulatedcheckbox">
</span>
Characteristics
Used in Roles
- checkbox
- option
- radio
- switch
Inherits into Roles
- menuitemcheckbox
- menuitemradio
- treeitem
Values
- tristate
- Value representing true or false, with an intermediate “mixed” value. The default value for this value type is False, unless otherwise specified.
- false
- The element supports being checked but is not currently checked.
- mixed
- Indicates a mixed mode value for a tri-state checkbox or menuitemcheckbox.
- true
- The element is checked.
- undefined (default)
- The element does not support being checked.
Semantic HTML
Use the HTML “checked” attribute.
<form action="/action_page.php">
<input type="checkbox" name="vehicle" value="Bike"> I have a bike<br>
<input type="checkbox" name="vehicle" value="Car" checked> I have a car<br>
<input type="submit" value="Submit">
</form>