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

HTML DOM Dialog Object

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.

element:

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

Try it

Creating the Dialog Object

You can create an element using the document.createElement() method.

element:

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

tag