Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Dialog object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Dialog object


Dialog object

Dialog objects are new to HTML5.

Dialog objects represent HTML and dialog elements.

Note: Currently only Chrome Canary, Safari 6, supports the elements.

Access the Dialog object

You can use getElementById() to access the elements:

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

Create a Dialog object

You can use the document.createElement() method to create an element:

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

Dialog object properties

Property Describe
open Set or go back to whether the conversation window is open
returnValue Set or return the return value of dialog

Dialog object method

Method Describe
close() Close the conversation window
show() The dialog box that is displayed
showModal() Displays the dialog box and makes it the top-level dialog box

Standard properties and events

Dialog objects also support standard properties and events.


Related articles

HTML Reference Manual: HTML slt;dialog> Tags