Example 1 — Get and Set (MDN)
Read the current modality, then set it to "false".
let el = document.getElementById("address-modal");
console.log(el.ariaModal); // "true"
el.ariaModal = "false";
console.log(el.ariaModal); // "false" How It Works
- Select the dialog. It already has
aria-modal="true". - Read
ariaModal. Returns the string"true". - Assign
"false". Updates the reflected attribute. - Read again. Confirms the dialog is no longer marked modal.

