/Web APIs

Element: ariaPressed property

The ariaPressed property of the Element interface reflects the value of the aria-pressed attribute, which indicates the current "pressed" state of toggle buttons.

Note: Where possible use an HTML <input> element with type="button" or the <button> element as these have built in semantics and do not require ARIA attributes.


A string with one of the following values:


The element is pressed.


The element supports being pressed but is not currently pressed.


Indicates a mixed mode value for a tri-state toggle button.


The element does not support being pressed.


In this example the aria-pressed attribute on the element with an ID of saveChanges is set to "false" indicating that this input is currently not pressed. Using ariaPressed we update the value to "true".

<div id="saveChanges" tabindex="0" role="button" aria-pressed="false">Save</div>
let el = document.getElementById("saveChanges");
console.log(el.ariaPressed); // "false"
el.ariaPressed = "true";
console.log(el.ariaPressed); // "true"


Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ariaPressed 81 81 No No 68 12.1 81 81 No 58 12.2 13.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.