HTML dialog Tag

HTML <dialog> Tag: The HTML<dialog> tag specifies a dialog box. This HTML dialog tag makes easy to create popup dialog boxes on a web page. This tag is new in HTML5.

HTML <dialog> Tag

This HTML<dialog> tag supports both the global and the event attributes.

Syntax: <dialog> Text </dialog>

Attributes

This tag accepts single attribute open which is used to specify the dialog element is active and the user can interact with tag element.

Browser compatibility

This HTML<dialog>tag is supported different types of browsers.

  • Chrome-37.0
  • Firefox-59.0
  • Safari-6.0
  • Opera-24.0
  • internet explorer- doesn’t support

Example:

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px solid black;
}
</style>
</head>
<body>
<table>
  <tr>
    <th>C <dialog open>These are programming language</dialog></th>
    <th>C++</th>
    <th>JAVA</th>
  </tr>
  <tr>
    <td>$31</td>
    <td>$28</td>
    <td>$31</td>
  </tr>
</table>
</body>
</html>

Output:

 

html dialog tag

Attributes that are supported by the <dialog> tag

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