Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>The HTML Dialog Object</h1> <h2>The showModal() Method</h2> <p>Click the button to show a modal dialog.</p> <button onclick="myFunction()">Show dialog</button> <p><b>Note:</b> Use the "Esc" button to close the modal.</p> <dialog id="myDialog">This is a dialog window</dialog> <script> function myFunction() { document.getElementById("myDialog").showModal(); } </script> </body> </html>