<dialog>
HTML DOM Dialog object
Dialog object
The Dialog object is new in HTML5.
A Dialog object represents an HTML <dialog> element.
Note: Currently only Chrome Canary, Safari 6 browsers support the <dialog> element.
Access the Dialog object
You can access the <dialog> element with getElementById():
var x = document.getElementById("myDialog");
Create a Dialog object
You can create <dialog> elements using the document.createElement() method:
var x = document.createElement("DIALOG");
Dialog object attributes
Attribute | Description |
---|---|
open | Set or return whether the dialog window is open |
returnValue | Set or return the dialog's return value |
Dialog object methods
Method | Description |
---|---|
close() | Close the dialog window |
show() | Display a dialog |
showModal() | Show the dialog and make it the topmost dialog |
Standard Properties and Events
Dialog objects also support standard properties and events .
Related articles
HTML Reference Manual: HTML <dialog> Tag