<dialog> showModal() / close()
The dialog element and its methods for opening it as a modal and closing it with a return value. Specification: html.spec.whatwg.org/multipage/interactive-elements.html.
Results
Probed on 2026-10-19 with Node.js v22.23.3.
warpdom 0.1.6
MissingMissing: in this engine's window, this does not hold: HTMLDialogElement exists and a <dialog> has showModal().
Web IDL existence (coverage):
- HTMLDialogElement: interface present; 1 of 7 members present, missing:
returnValue,closedBy,show,showModal,close,requestClose.
happy-dom 21.0.3
Partial2 of 3 checks work.
Web IDL existence (coverage):
-
HTMLDialogElement: interface present; 5 of 7 members present, missing:
closedBy,requestClose. -
showModal() on a dialog that is not in a document throws an "InvalidStateError" DOMException.
- Result:
showModal() on a disconnected dialog: expected InvalidStateError, nothing was thrown
- Result:
jsdom 30.1.3
MissingMissing: in this engine's window, this does not hold: HTMLDialogElement exists and a <dialog> has showModal().
Web IDL existence (coverage):
- HTMLDialogElement: interface present; 1 of 7 members present, missing:
returnValue,closedBy,show,showModal,close,requestClose.
linkedom 0.18.13
MissingMissing: in this engine's window, this does not hold: HTMLDialogElement exists and a <dialog> has showModal().
Web IDL existence (coverage):
- HTMLDialogElement: interface not defined.
Checks
Exists when: HTMLDialogElement exists and a <dialog> has showModal().
show-modal-opens: showModal() on a connected dialog sets .open to true and adds the open attribute. (spec)close-return-value: close("done") clears open, sets returnValue to "done" and fires a "close" event. (spec)disconnected-throws: showModal() on a dialog that is not in a document throws an "InvalidStateError" DOMException. (spec)