ARIA States & Properties
aria-pressed
Indicates the state of a toggle button. False is unpressed, true pressed, mixed a mixed state, and omission indicates a regular button. Keep the accessible label stable and synchronize the actual toggle behavior. Value type: tristate. Accepted values: true, false, mixed, undefined. Default or omitted behavior: undefined. Applicable context: button. Use only where allowed for the element’s implicit or explicit role. ARIA describes accessibility semantics; it does not automatically implement the associated behavior. Test with the relevant browser and assistive technology.
Formal Syntax & Structure
html syntaxhtml
aria-pressed="false"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| aria-pressed | tristate | Accepted values: true, false, mixed, undefined. Default or omitted behavior: undefined. Context: button. Requiredness depends on the role. |
Working Example
Example Snippethtml
<style> button[aria-pressed=true]{font-weight:bold;border:3px solid currentColor}</style><button aria-pressed="false" onclick="this.setAttribute('aria-pressed',String(this.getAttribute('aria-pressed')!=='true'))">Bold</button>