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;

Try it yourself

Example 2

Check if the dialog window is open:

var x = document.getElementById("myDialog").open;

Try it yourself

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.

  • true - The dialog window is open
  • false - Default. The dialog window is not open

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