HTML aria-modal ARIA Attribute
The aria-modal attribute tells assistive technology that a dialog is modal, so content outside it can't be used while it is open.
Description
The aria-modal attribute marks a dialog or alertdialog as modal: while it is open, the rest of the page can't be used. Assistive technology may then limit navigation to the dialog's content, so users don't wander into the page behind it.
The attribute only tells assistive technology about the modal behavior; it doesn't create it. Your script still has to move focus into the dialog, keep it there while it is open, close it with Escape and return focus to the control that opened it. Making the background inert is the most reliable way to block it.
The native <dialog> element opened with showModal() does all of this for you and is treated as modal automatically, so it doesn't need aria-modal.
Properties
- Type
- Widget
- Value
- true/false
- Default
false- Used with
alertdialog,dialog
Syntax
<element role="dialog" aria-modal="true | false">
Values
- trueThe element is modal.
- falseThe default: the element is not modal.
Example
Browser Support
The following information will show you the current browser support for the aria-modal ARIA attribute. Hover over a browser icon to see the version that first introduced support for this ARIA attribute.
Desktop





Tablets & Mobile





