The HTML aria-haspopup attribute
The aria-haspopup attribute indicates that a control opens a popup, and what type it is. Values: menu, listbox, tree, grid, dialog, or true (which means menu). Use false or omit when there is no popup.
Overview
The aria-haspopup attribute indicates that an element triggers a popup such as a menu, listbox or dialog.
It is a widget state — a condition that can change as the user interacts. Because ARIA does nothing on its own, you must update this value in JavaScript every time the underlying state changes; a stale state is worse than none. And wherever a native element already expresses the same thing (a checkbox's checked state, the disabled attribute, a <details>'s open state), use that instead.
Like all ARIA, aria-haspopup changes only the accessibility tree — what assistive technology perceives — never the element's behavior or appearance. The first rule of ARIA applies: if a native HTML element or attribute conveys this, use that instead, and only reach for ARIA when nothing native fits.
Syntax
<button aria-haspopup="menu" aria-expanded="false">Options</button>
Values
| Value |
|---|
| false | true | menu | listbox | tree | grid | dialog |
Example
<button aria-haspopup="listbox" aria-expanded="false" aria-controls="lb">Country</button>
Best practices
- Follow the first rule of ARIA — use a native HTML element or attribute that conveys this where one exists, rather than adding ARIA.
- Update the value in JavaScript whenever the state changes — keep it in sync with reality.
- Use the matching native state where one exists (a checkbox's
checked, thedisabledattribute, a <details>'s open state) instead of the ARIA version. - Set it only on an element whose role actually supports this state.