Javascript examples for DOM HTML Element:Dialog
The showModal() method shows the dialog and prevents user from interacting with other elements on the page.
Show a model dialog window
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Show dialog</button> <dialog id="myDialog">This is a dialog window</dialog> <script> function myFunction() {/*from w w w .j a va 2s .c o m*/ document.getElementById("myDialog").showModal(); } </script> </body> </html>