<button close_all_dialogs>close all dialogs</button>
<button open_all_dialogs>open all dialogs</button>
<button open_dialog1>open dialog 1</button>
<button open_dialog2>open dialog 2</button>
<button open_dialog1_dialog2>open dialog 1 then dialog 2</button>
<button open_dialog2_dialog1>open dialog 2 then dialog 1</button>
<dialog DISABLEDopen id="dialog1">
<form method="dialog">
Dialog 1
<button value="v1a">1a</button>
<button value="v1b">1b</button>
<button>close</button>
<hr>
more content to make the 1st dialog bigger so it shows behind the 2nd.
</form>
</dialog>
<dialog DISABLEDopen id="dialog2">
<form method="dialog">
Dialog 2
<button value="v2a">2a</button>
<button value="v2b">2b</button>
<button>close</button>
</form>
</dialog>
<dialog open id="dialog3">
Dialog 3
<button onclick="this.closest('dialog').close();">close</button>
</dialog>
<div>
Several things to note (using chromium):<br>
<ul>
<li>A <code><dialog open></code> element is visible from pageload, but it does not prevent clicking anything outside the dialog, and the (darkened) backdrop is not visible.
<li>A <code><dialog open></code> element position on pageload is different from when opened using <code>dialog.showModal()</code>.
<li>Having 2 dialogs open at the same time is possible. it seems the last opened or the "last in DOM" element is the one on top.
<li>Calling <code>dialog.showModal()</code> on an already open dialog throws an error:<br>
<code>Failed to execute 'showModal' on 'HTMLDialogElement': The element already has an 'open' attribute, and therefore cannot be opened modally.</code>
<li>Clicking a <code><button></code> element without explicit <code>value</code> attribute set, does not set the <code>dialog.returnValue</code> property.
<li>The backdrop style can be targeted using css <code>dialog::backdrop { ... }</code>.
<li>Hitting <code>ESC</code> key will close the last opened or "last in DOM" dialog, throwing a...