Dialog showModal() method

Definition and Usage

showModal() Method to display the dialog.

When this method is used to display the dialog window, the user cannot interact with other elements on the page.

Tip:If you want the user to interact with other elements on the page while the dialog is displayed, use show() method.

Tip:This method is usually used with close() method Used together.

See also:

HTML Reference Manual:HTML <dialog> Tag

Example

Display the dialog window:

document.getElementById("myDialog").showModal();

Try It Yourself

Syntax

dialogObject.showModal()

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
37.0 Not Supported Not Supported 6.0 24.0