Tutorialspoint.dev

HTML5 | <dialog> Tag

The <dialog> tag is used to specify the dialog box or window. This tag is used to create popup dialog and models on a web page. This tag is new in HTML5.

Syntax:

<dialog open> Contents... </dialog>

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

Example:

<!DOCTYPE html>
<html>
    <head>
        <title>dialog tag</title>
        <style>
            dialog {
                color:green;
                font-size:30px;
                font-weight:bold;
                font-style:italic;
            }
            body {
                text-align:center;
            }
        </style>
    </head>
    <body>
        <h1><dialog> tag</h1>
        <dialog open>Welcome to GeeksforGeeks</dialog>
    </body>
</html>                    

Output:
dialog tag

Supported Browsers: The browser supported by <dialog> tag are listed below:

  • Apple Safari 6.0
  • Google Chrome 37.0
  • Firefox 59.0
  • Opera 24.0

Note:: It is not supported by Internet Explorer.



This article is attributed to GeeksforGeeks.org

leave a comment

code

0 Comments

load comments

Subscribe to Our Newsletter