X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM Dialog Object


Dialog Object

The Dialog Object is new in HTML5.

The Dialog object represents an HTML <dialog> element.

Note: The <dialog> element is currently only supported in Chrome Canary (with a flag), and Safari 6.

Access a Dialog Object

You can access a <dialog> element by using getElementById():

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

Create a Dialog Object

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

var x = document.createElement("DIALOG"); Try it

Dialog Object Properties

Property Description
open Sets or returns whether a dialog should be open or not
returnValue Sets or returns the dialog's return value

Dialog Object Methods

Method Description
close() Closes the dialog
show() Shows the dialog
showModal() Shows the dialog and makes it the top-most modal dialog

Standard Properties and Events

The Dialog object also supports the standard properties and events.


Related Pages

HTML reference: HTML <dialog> tag



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook