Dialog open Property - Find out if a dialog window is open or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Dialog

Description

Dialog open Property - Find out if a dialog window is open or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<dialog id="myDialog" open>This is an open dialog window</dialog>

<script>
function myFunction() {//from   w ww .  ja  va2 s .c om
    var x = document.getElementById("myDialog").open;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials