Javascript examples for DOM HTML Element:Dialog
The show() method shows the dialog.
The following code shows how to Show and close a dialog window:
<!DOCTYPE html> <html> <body> <button onclick="showDialog()">Show dialog</button> <button onclick="closeDialog()">Close dialog</button> <dialog id="myDialog">This is a dialog window</dialog> <script> var x = document.getElementById("myDialog"); function showDialog() {/*from w w w . j a v a2s . co m*/ x.show(); } function closeDialog() { x.close(); } </script> </body> </html>