Dialog open Property
Definition and Usage
The open property is used to set or return whether the dialog window is open.
This property reflects the <dialog> open attribute.
If this attribute is specified, it indicates that the dialog window is available and the user can interact with it.
Note:The <dialog> element is new in HTML5.
Browser Support
![]()
![]()
![]()
![]()
![]()
Note:Currently only Chrome Canary and Safari 6 browsers 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
Return 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
|
Technical Details
| Return Value: | A Boolean value, returns TRUE if the dialog window is open, otherwise returns FALSE. |
|---|
More Examples
Example
Check whether the dialog window is open:
var x = document.getElementById("myDialog").open;
xThe output result is:
true
Try it yourself »
Related Articles
HTML Reference Manual:HTML <dialog> open Attribute
Other Extensions
Dialog Object