THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Dialog showModal() Method

Dialog Object Reference Dialog Object

Example

Show a dialog window:

document.getElementById("myDialog").showModal();
Try it yourself »

Definition and Usage

The showModal() method shows the dialog.

When this method is used to show a dialog window, the user is not able to interact with other elements on the page. Use the show() method if you want the user to interact with other elements on the page whilst the dialog is shown.

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The showModal() method is currently only supported in Opera 24+, Chrome 37+ and Safari 6.


Syntax

dialogObject.showModal()

Dialog Object Reference Dialog Object