Dialog open attribute
Definition and usage
open
whether the attribute is set or returned to open the dialog.
This attribute reflects dialog open attribute.
When set, it specifies that the dialog element is in an active state and the user can interact with it.
See also:
HTML Reference Manual:HTML <dialog> Tag
Example
Example 1
Open the dialog window:
document.getElementById("myDialog").open = true;
Example 2
Check if the dialog window is open:
var x = document.getElementById("myDialog").open;
Syntax
Return the open attribute:
dialogObject.open
Set the open attribute:
dialogObject.open = true|false
attribute value
value | description |
---|---|
true|false |
Specify whether the dialog window should be opened.
|
Technical Details
Return Value: | Boolean value, returns true if the dialog window is open, otherwise returns false. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Not Supported | Not Supported | Supported | Supported |
Related Pages
HTML Reference Manual:HTML <dialog> open Attribute