HTML DOM Dialog open Property
Definition and Usage
The open property sets or returns whether a dialog window is open.
This property reflects the HTML <dialog> open attribute.
If the attribute is specified, it indicates that the dialog is active and available for interaction.
Note: The <dialog> element is new in HTML5.
Browser Support
Note: Currently, only Chrome Canary and Safari 6 support the open property.
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
Get the open property:
dialogObject.open
Set the open property:
dialogObject.open=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Specifies whether the dialog window is open. * true - The dialog window is open. * false - Default. The dialog window is closed. |
Technical Details
| Return Value: | A Boolean. Returns TRUE if the dialog window is open, otherwise FALSE. |
|---|
More Examples
Example
Check if the dialog window is open:
var x = document.getElementById("myDialog").open;
The output of x will be:
true
Related Articles
HTML Reference: HTML <dialog> open Attribute
YouTip