YouTip LogoYouTip

Dom Obj Dialog

# HTML DOM Dialog Object * * * ## Dialog Object The Dialog object is new in HTML5. The Dialog object represents an HTML `` element. **Note:** Currently, only Chrome Canary and Safari 6 browsers support the `` element. ### Accessing the Dialog Object You can access the `` element using `getElementById()`: ```javascript var x = document.getElementById("myDialog"); (#) ### Creating a Dialog Object You can create a `` element using the `document.createElement()` method: ```javascript var x = document.createElement("DIALOG"); (#) ## Dialog Object Properties | Property | Description | | --- | --- | | (#) | Sets or returns whether a dialog window is open or not | | returnValue | Sets or returns the return value of a dialog | ## Dialog Object Methods | Method | Description | | --- | --- | | [close()](#) | Closes the dialog window | | [show()](#) | Shows the dialog | | [showModal()](#) | Shows the dialog and makes it the top-layer dialog | ## Standard Properties and Events The Dialog object also supports standard (#) and (#). * * * ## Related Articles HTML Reference: [HTML `` Tag](#)
← Prop Dialog OpenRuby Array β†’