aria-haspopup attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.
In ARIA, interactive menus, listboxes, trees, grids, and dialogs that appear on top of other content when triggered to appear are considered "popups". These popups are triggered by one or more interactive elements on the page. The availability and type of popup the interactive element will trigger should be identified with the
The presence of the
aria-haspopup, with one of six enumerated values -
true - indicates the element can trigger a popup and what kind of popup will be displayed. In turn, the element that pops up must be of the role indicated. The value
true is the same as
menu. Any other value, including an empty string or other role, is treated as if
false were set.
tooltip is not considered to be a popup in this context, as it is not interactive.
Note: Make sure the role of the element that serves as the container for the popup content is a
dialog and that the value of
aria-haspopup matches the role of the popup container.
aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity. For the popup to be keyboard accessible, make sure the element with
aria-haspopup is focusable and can trigger the popup, that there is a keyboard mechanism for opening the popup, and that the popup element manages focus of all its descendants.
Note: ARIA does not enable accessible functionality. ARIA only conveys the intended behavior of your functionality.
When creating a
menubar, a parent
menuitem should have
true) set. Any button that open a menu should have a role of
button or, preferably, be a
<button>, and also have
Tab elements with popup menus should also have
aria-haspopup="menu" set. Note that
menubars should not be used to create website navigation.
Note: Elements with role
combobox have an implicit
aria-haspopup value of
The element does not have a popup.
The popup is a menu.
The popup is a menu.
The popup is a listbox.
The popup is a tree.
The popup is a grid.
The popup is a dialog.
ariaHasPopupproperty, part of the
Elementinterface, reflects the value of the
aria-haspopupattribute, which indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
ariaHasPopupproperty of the
ElementInternalsinterface reflects the value of the
Used in roles:
Inherited into roles:
|Accessible Rich Internet Applications (WAI-ARIA) |
- Toolbar example - W3C WAI ARIA practices