Example

A simple <dialog> tag:

Laboratory

description & Usage

The <dialog> tag is used to create a popup dialog box, modal dialog, or pop-up window.

By default, the content within the <dialog> tag is hidden. It can be shown by setting the open attribute.

Notes

The <dialog> tag only has one attribute: open. This attribute is what displays the content inside the <dialog> element.

The open attribute does not have a value. It is either present or not.

The <dialog> tag is typically used in conjunction with JavaScript. JavaScript is used to open and close the <dialog>.

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
<dialog>

Attributes

Attributes Values Description
open
open
It is used to display text, video and audio content to the user.

Global Attributes

The <dialog> tag supports the HTML Global Attributes.

Event Attributes

The <dialog> tag supports the HTML Event Attributes.

Default CSS

Most browsers will display the <dialog> tag with the following default style: