content logo

Learn HTML:

Html dialog tag

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.

 

Example code

<dialog open>
  <p>Hey, I'm a dialog box!</p>
</dialog>

Attributes

 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
#HTML Dialog Tag Definition #HTML Dialog Tag Usage #HTML Dialog Tag Examples