DIALOG <dialog> Tag

by Jai 22-Jun-19

0 640

The <dialog> tag is used to construct a dialog box and window including a popup or modal window on a web page. This tag is not compatible in an Internet Explorer.

<!DOCTYPE html>
<title> Dialog With JavaScript </title>
dialog {
width: 50%;

<dialog id="DialogboxExample">
This is a dialog window.
<button id="hide">Close dialog text</button>
<button id="show">Show dialog text</button>
<p><b>Note:</b> The dialog tag is not supported in Internet Explorer.</p>
<script type="text/JavaScript">
(function() {
var dialog = document.getElementById('DialogboxExample');
document.getElementById('show').onclick = function() { dialog.show();
document.getElementById('hide').onclick = function() { dialog.close();



DIALOG <dialog> Tag


Leave a Reply

    Waiting for your comments