Easy Tutorial
❮ Met Node Comparedocumentposition Prop Script Text ❯

Dialog showModal() Method

Dialog Object

Example

Display a dialog window:


Definition and Usage

The showModal() method is used to display a dialog window, preventing user interaction with other elements on the page. If you want the user to interact with the page while the dialog is open, you can use the show() method instead.

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


Browser Support

Note: Currently, only Chrome Canary and Safari 6 support the showModal() 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 navigating to chrome://flags. After enabling, you need to restart Chrome.


Syntax


Dialog Object

❮ Met Node Comparedocumentposition Prop Script Text ❯