HTML 5 · Text, links and media
Create a modal dialog
Use the built-in dialog element. Call showModal() to open it and close() to close it.
<dialog id="confirm">
<p>Are you sure?</p>
<form method="dialog"><button>OK</button></form>
</dialog>
HTML 5 · Text, links and media
Use the built-in dialog element. Call showModal() to open it and close() to close it.
<dialog id="confirm">
<p>Are you sure?</p>
<form method="dialog"><button>OK</button></form>
</dialog>
Was this page helpful?