The ariaModal property of the Element interface reflects the value of the aria-modal attribute, which indicates whether an element is modal when displayed.


var ariaModal = element.ariaModal;
element.ariaModal = ariaModal


A DOMString with one of the following values:

The element is modal.
The element is not modal.


In this example the aria-modal attribute on the element with an ID of address-modal is set to "true" indicating that this is a modal dialog. Using ariaModal we update the value to "false".

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


Specification Status Comment
Accessible Rich Internet Applications (WAI-ARIA) 1.2
The definition of 'ariaModal' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also