X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Dialog show() Method

Dialog Object Reference Dialog Object

Example

Show and close a dialog window:

var x = document.getElementById("myDialog");

function showDialog()
  {
  x.show();
  }

function closeDialog()
  {
  x.close();
  }

Try it yourself »


Definition and Usage

The show() method shows the dialog.

When this method is used to show a dialog window, the user is still able to interact with other elements on the page. If you do not want the user to interact with things other than the dialog, use the showModal() method.

Tip: This method is often used together with the close() method.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The show() method is currently only supported in Chrome Canary, and Safari 6.

Note: Even though the <dialog> element is supported in Chrome Canary, you must enable a flag to use it. Write chrome://flags in your address bar and enable the "Enable experimental Web Platform features" flag. Once this is enabled, you must restart the browser for the change to take effect.


Syntax

dialogObject.show()


Dialog Object Reference Dialog Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook