Latest web development tutorials

HTML DOM Dialog Object

Dialog Object

HTML5 is the new Dialog object.

Dialog object represents an HTML <dialog> element.

Note: Currently, only Chrome Canary, Safari 6 browser supports the <dialog> element.

Access Dialog Object

You can use getElementById () to access the <dialog> element:

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

Create Dialog Object

You can use document.createElement () method to create a <dialog> element:

var x = document.createElement ( "DIALOG" ); try

Object Properties Dialog

Attributes description
open Sets or returns the conversation window is open
returnValue Sets or returns the return value of dialog

Dialog Object

method description
close () Close the dialog window
show () Display dialog
showModal () Display the dialog box, and make it topmost dialog

Standard properties and events

Dialog object also supports the standard attributes and events .


related articles

HTML Reference Manual: HTML <Dialog> tag