DOM Properties

HTMLDialogElement.open

Read/write. Reflects the open attribute. It distinguishes an open dialog from a closed one, not modal from non-modal. Use showModal, show and close instead of directly removing open to preserve native lifecycle and focus behavior. Example result: true / false.

Formal Syntax & Structure

html syntaxhtml
element.open

Return Value

boolean

Property value. Read/write.

Working Example

Example Snippethtml
<dialog id="demo" aria-label="Notice" open>Notice</dialog><p>  Result:  <output id="result"></output></p><script>  const e = document.getElementById('demo');  const result = value => { document.getElementById("result").textContent = String(value); };  result(e.open+' / '+e.matches(':modal'));</script>

Browser Compatibility

Minimum supported versions across modern rendering engines

Widely Available (2022)
Blink
Chrome
37+
Yes
Gecko
Firefox
98+
Yes
WebKit
Safari
15.4+
Yes
Basic feature support; newer dialog members have their own compatibility.
HTML Living Standard
HTML Reference