X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Dialog open Property

Dialog Object Reference Dialog Object

Example

Open a dialog window:

document.getElementById("myDialog").open = true;

Try it yourself »


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

Internet Explorer Firefox Opera Google Chrome Safari

The open property is currently only supported in Chrome Canary, and Safari 6.

Note: Even though the <dialog> element is supported in Chrome Canary, you must enable a flag to use it. Write chrome://flags in your address bar and enable the "Enable experimental Web Platform features" flag. Once this is enabled, you must restart the browser for the change to take effect.


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
  • true - The dialog window is open
  • false - Default. The dialog window is not open

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 Reference Dialog Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook