Easy Tutorial
❮ Event Img Onload Jsref Ln10 ❯

HTML DOM Dialog Object


Dialog Object

The Dialog object represents the HTML <dialog> element.

Note: Currently, only Chrome Canary and Safari 6 browsers support the <dialog> element.

Accessing the Dialog Object

You can access the <dialog> element using the getElementById() method:

Creating a Dialog Object

You can create a <dialog> element using the document.createElement() method:

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
showModal() Displays the dialog and makes it the topmost dialog

Standard Properties and Events

The Dialog object also supports standard properties and events.


Related Articles

HTML Reference: HTML <dialog> Tag

❮ Event Img Onload Jsref Ln10 ❯