aria-pressed attribute | ariaPressed property
[This documentation is preliminary and is subject to change.]
Sets or retrieves the pressed state of a button that can be toggled.
![]() |
Syntax
| HTML |
|---|
<element aria-pressed="p" ... > |
| JavaScript |
|---|
object.setAttribute("aria-pressed",value);var value = object.getAttribute("aria-pressed");
|
Property values
Type: String
The pressed state.
(true)
-
The element is down (button pressed).
(false)
-
The element is up.
(mixed)
-
The element indicates both pressed and unpressed states.
(undefined)
-
Default. The element state is unknown.
Remarks
Buttons with a defined ariaPressed state can be toggled. (When ariaPressed is true the button is down, when false it is up.) Simple command buttons do not need to define a ariaPressed state.
Note For cross-browser compatibility, always use the WAI-ARIA attribute syntax to access and modify ARIA properties, for example object.setAttribute("aria-valuenow", newValue).
See also
Build date: 2/13/2012
