Dialog open Property
Definition and Usage
The open property sets or returns whether a dialog should be open or not.
This property reflects the <dialog> open attribute.
When present, it specifies that the dialog element is active and that the user can interact with it.
Note: The <dialog> element is new in HTML5.
Browser Support
The open property is currently only supported in Opera 24+, Chrome 37+ and Safari 6.
Syntax
Return the open property:
dialogObject.open
Set the open property:
dialogObject.open=true|false
Property Values
Value | Description |
---|---|
true|false |
Specifies whether a dialog window should be open or not
|
Technical Details
Return Value: | A Boolean, returns true if the dialog window is open, otherwise it returns false |
---|
More Examples
Example
Find out if a dialog window is open or not:
var x = document.getElementById("myDialog").open;
The result of x will be:
true
Try it yourself »
Related Pages
HTML reference: HTML <dialog> open attribute
Dialog Object