Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Dialog open property

Dialog open property

Dialog Object Reference Dialog Object

Example

Open the dialog window:

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

Try it »


Definition and Usage

The open property is used to set or return whether the dialog window is open.

This property reflects

The open property.

If this attribute is specified, it means the dialog window is available and the user can interact with it.

Note:

The element is newly added in HTML5.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Note: Currently only Chrome Canary and Safari 6 browsers support the open property.

Note: Even if Chrome Canary supports

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

Attribute values

Value Description
true|false  Specifies whether the dialog window is open
  • true - The dialog window is open
  • false - Default. The dialog window is closed.
  • |

    Technical Details

    Return Value: Boolean, 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;

    x

    The output is:

    true

    Try it »


    Related Articles

    HTML Reference Manual: HTML

    open property


    Dialog Object Reference Dialog Object