Easy Tutorial
❮ Prop Number Autofocus Prop Style Font ❯

Dialog show() Method

Dialog Object

Example

Display or close a dialog window:


Definition and Usage

The show() method is used to display a dialog window.

When this method is used to display a dialog window, the user can still interact with other elements on the page. If you do not want the user to interact with the page while the dialog is open, you can use the showModal() method.

Tip: This method is usually used in conjunction with the close() method.


Browser Support

Note: Currently, only Chrome Canary and Safari 6 support the show() method.

Note: Even if Chrome Canary supports the <dialog> element, you must enable the "Enable experimental Web Platform features" flag in the Chrome address bar by opening chrome://flags. After enabling it, you need to restart the Chrome browser.


Syntax


Dialog Object

❮ Prop Number Autofocus Prop Style Font ❯