Dialog show() method

Definition and Usage

show() method to display the dialog.

When this method is used to display the dialog window, the user can still interact with other elements on the page. If you do not want the user to interact with anything outside the dialog, please use showModal() method.

Tip:This method is usually used with close() method Used together.

See also:

HTML Reference Manual:HTML <dialog> Tag

Example

Display and close the dialog window:

var x = document.getElementById("myDialog"); 
function showDialog() { 
  x.show(); 
} 
function closeDialog() { 
  x.close(); 
}

Try It Yourself

Syntax

dialogObject.show()

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
37.0 Not Supported Not Supported 6.0 24.0