THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML

Dialog close() 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 close() method closes the dialog.

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


Browser Support

Method
close() 37.0 Not supported Not supported 6.0 24.0

Syntax

dialogObject.close()

Dialog Object Reference Dialog Object