Element.ariaModal is an instance property that reflects the aria-modal attribute. Learn the true and false tokens, how modal dialogs signal that outside content is inert, and how to get or set the property from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String
03
Values
true · false
04
Reflects
aria-modal
05
Status
Baseline widely
06
Common with
role="dialog"
Fundamentals
Introduction
A modal dialog asks the user to finish something before returning to the page: confirm a delete, pick an address, complete a form. Sighted users see a backdrop. Assistive technologies need an explicit signal that the dialog is modal.
aria-modal carries that signal. ariaModal is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("address-modal");
console.log(el.ariaModal); // "true"
el.ariaModal = "false";
💡
Beginner tip (MDN)
On an element with role="dialog", aria-modal="true" replaces the older technique of setting aria-hidden on the background to tell AT that outside content is inert. You still need focus management (or a native <dialog> with showModal()) for a complete modal UX.
Concept
Understanding the Property
MDN: the ariaModal property of the Element interface reflects the value of the aria-modal attribute, which indicates whether an element is modal when displayed.
Reflected attribute — mirrors aria-modal.
Get / set — readable and writable string.
Two tokens — true, false.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaModal
Value
A string with one of the following values:
Value
Meaning (MDN)
"true"
The element is modal.
"false"
The element is not modal.
⚠️
Signal vs behavior
ariaModal informs assistive technologies. Trap focus, handle Escape, and inert the background (or use native modal dialog APIs) so keyboard users get the same modality sighted users expect.
Pattern
📋 MDN Example Shape
MDN starts with aria-modal="true" on a dialog, then updates it to "false":
Element.ariaModal is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaModal
String true / false — reflects aria-modal for whether a displayed element is modal.
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaModal IDL — use setAttribute
No
ariaModalBaseline
Bottom line: Use ariaModal on dialogs to declare modality for assistive technologies. Pair with focus management (or native dialog showModal). Prefer aria-modal over hiding the whole background with aria-hidden.
Wrap Up
Conclusion
ariaModal reflects aria-modal so dialogs can declare whether they are modal. Use it with role="dialog", keep an accessible name, and still implement focus and backdrop behavior—or lean on native <dialog> when it fits.
Assume the property alone blocks keyboard access outside
Open unnamed dialogs
Leave focus behind the backdrop
Mark non-modal panels as modal
Forget to restore focus when the dialog closes
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaModal
Reflected aria-modal string for dialog modality.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
true / false
modal or not
Values
🔍03
dialog role
common pairing
Use
✅04
Baseline
widely available
Status
🎯05
Still manage focus
signal ≠ trap
Rule
❓ Frequently Asked Questions
It reflects the aria-modal attribute as a string, indicating whether an element is modal when displayed—so assistive technologies treat content outside the dialog as inert.
No. MDN marks Element.ariaModal as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "true" (the element is modal) or "false" (the element is not modal).
MDN: applying aria-modal on an element with role="dialog" replaces the older technique of using aria-hidden on the background to tell AT that outside content is inert.
No. It is an accessibility signal. You still need keyboard focus management (and often inert/backdrop behavior) for a complete modal experience—or use the native HTML dialog with showModal().
Yes. Reading and writing ariaModal updates the reflected aria-modal attribute.
Did you know?
The native HTML <dialog> element with showModal() creates a top-layer modal with built-in focus behavior. Custom dialogs still benefit from ariaModal = "true" so AT knows the intent matches that pattern.