Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Element
  4. ariaModal

Element: ariaModal property

Baseline 2023
Newly available

Since ⁨October 2023⁩, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

TheariaModal property of theElement interface reflects the value of thearia-modal attribute, which indicates whether an element is modal when displayed. Applying thearia-modal property to an element withrole="dialog" replaces the technique of using aria-hidden on the background for informing assistive technologies that content outside a dialog is inert.

Value

A string with one of the following values:

"true"

The element is modal.

"false"

The element is not modal.

Examples

In this example thearia-modal attribute on the element with an ID ofaddress-modal is set to "true" indicating that this is a modal dialog. UsingariaModal we update the value to "false".

html
<div  role="dialog"   aria-labelledby="dialog1Title"  aria-describedby="dialog1Desc"  aria-modal="true"></div>
js
let el = document.getElementById("address-modal");console.log(el.ariaModal); // "true"el.ariaModal = "false";console.log(el.ariaModal); // "false"

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariamodal

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp