HTML Tags

HTML5 <dialog> Tag

Topic: HTML5 Tags ReferencePrev|Next

Description

The <dialog> element defines a dialog box or other interactive component on a web page that a user can interacts with to perform a task, such as a dismissible alert.

The following table summarizes the usages context and the version history of this tag.

Placement: Block
Content: Block, inline, and text
Start/End Tag: Start tag: required, End tag: required
Version: New in HTML5

Syntax

The basic syntax of the <dialog> tag is given with:

HTML / XHTML: <dialog> ... </dialog>

The example below shows the <dialog> tag in action.

<dialog open>
    <p>Are you sure you want to remove this item?</p>
    <button type="button">Yes</button>
    <button type="button">No</button>
</dialog>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <dialog> tag.

Attribute Value Description
open open Specifies that the dialog element is active and that the user can interact with it.

Global Attributes

Like all other HTML tags, the <dialog> tag supports the global attributes in HTML5.


Event Attributes

The <dialog> tag also supports the event attributes in HTML5.


Browser Compatibility

The <dialog> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 22+
  • Google Chrome 37+
  • Edge 79+
  • Apple Safari ×
  • Opera 49+

Further Reading

See tutorial on: HTML Forms.

Related tags: <form>, <input>, <button>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties