Dialog close()Method
Example
Show and close the dialog window:
var x = document.getElementById("myDialog");
function showDialog()
{
x.show();
}
function closeDialog()
{
x.close();
}
function showDialog()
{
x.show();
}
function closeDialog()
{
x.close();
}
Try it »
Definition and Usage
The close() method is used to close the dialog window.
Tip:This method is usually used together with theshow()method.
Browser Support
![]()
![]()
![]()
![]()
![]()
Note:Currently only Chrome Canary and Safari 6 browsers support the close() method.
Note:Even though Chrome Canary supports the <dialog> element, you must open chrome://flags in the Chrome address bar and enable the "Enable experimental Web Platform features" flag. After enabling it, you need to restart the Chrome browser.
Syntax
dialogObject.close()
Other Extensions
Dialog Object