HTML aria-expanded ARIA Attribute
The aria-expanded attribute tells assistive technology whether a control, such as a menu button or accordion header, has its related content expanded (true) or collapsed (false).
Description
The aria-expanded attribute is set on a control, such as a button, to say whether the content it shows and hides is currently expanded or collapsed. It is used for disclosure widgets, accordions, drop-down menus, combo boxes and tree items. Screen readers announce the state, for example "Menu, button, collapsed", so users know whether activating the control will open or close something.
The attribute goes on the element that the user activates, not on the content that appears. Update it with JavaScript every time the state changes. It is often combined with aria-controls, which points to the content being shown or hidden. When the attribute is left out, the element is not expandable at all, which is different from false.
Native HTML can handle this for you. A <details> element exposes its open state automatically, and a button with popovertarget reports the state of its popover, so no aria-expanded is needed in those cases.
Properties
Syntax
<element aria-expanded="true | false">
Values
- trueThe element it controls is expanded (shown).
- falseThe element it controls is collapsed (hidden).
- undefinedThe default when the attribute is left out: the element is not expandable.
Example
Browser Support
The following information will show you the current browser support for the aria-expanded ARIA attribute. Hover over a browser icon to see the version that first introduced support for this ARIA attribute.
Desktop





Tablets & Mobile





