Indicates the current “pressed” state of toggle buttons. See related aria-checked and aria-selected.
Toggle buttons require a full press-and-release cycle to change their value. Activating it once changes the value to true, and activating it another time changes the value back to false. A value of mixed means that the values of more than one item controlled by the button do not all share the same value. Examples of mixed-state buttons are described in WAI-ARIA Authoring Practices [wai-aria-practices-1.1]. If the attribute is not present, the button is not a toggle button.
The aria-pressed attribute is similar but not identical to the aria-checked attribute. Operating systems support pressed on buttons and checked on checkboxes.
HTML Example 2
<div role="toolbar" aria-label="sorting options" aria-controls="sortable">
<button type="button" aria-pressed="true" data-sort="ascending">A to Z</button>
<button type="button" aria-pressed="false" data-sort="descending">Z to A</button>
<ul id="sortable" tabindex="-1">
Used in Roles
- Value representing true or false, with an intermediate “mixed” value. The default value for this value type is False, unless otherwise specified.
- The element supports being pressed but is not currently pressed.
- Indicates a mixed mode value for a tri-state toggle button.
- The element is pressed.
- undefined (default)
- The element does not support being pressed.