HTML DOM Dialog Object
Dialog Object
The Dialog object is new in HTML5.
The Dialog object represents an HTML element.
Note: Currently only Chrome Canary and Safari 6 browsers support it.
Accessing the Dialog Object
You can use getElementById() to access an element.
var x = document.getElementById("myDialog");
Try it
Creating the Dialog Object
You can create an element using the document.createElement() method.
var x = document.createElement("DIALOG");
Try it
Dialog Object Properties
| property | Description |
|---|---|
| open | Sets or returns whether the dialog window is open. |
| returnValue | Sets or returns the return value of the dialog. |
Dialog Object Methods
| Method | Description |
|---|---|
| close() | Closes the dialog window. |
| show() | Displays the dialog box. |
| showModal() | Displays the dialog box and makes it the topmost dialog. |
Standard properties and events
The Dialog object also supports standard property and Events.
Related Articles
HTML Reference Manual: HTML