When writing in HTML, the <dialog> tag is used to create a dialog box or modal window on a web page. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.
<dialog open>
<p>Hey, I'm a dialog box!</p>
</dialog>
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <dialog> tag, as well as a description of each.
Attribute | Description |
---|---|
open | Designates that the dialog element is ready for use |