BOM Browser Object Model Window Open and Close Method tutorial in JavaScript

 <!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>BOM Window Open Close Method JavaScript</title>
</head>

<body>
    <button onclick="openWindow()">Open Window</button>
    <button onclick="closeWindow()">Close Window</button>
    <script>
        var myWindow;
        function openWindow() {
            myWindow = window.open("http://www.youtube.com", "_blank", "width=500px,height=200px,left=500px,top=200px");
        }
        function closeWindow() {
            myWindow.close();
        }
    </script>
</body>

</html>




Comments

Popular posts from this blog

Generators tutorial in Advance JavaScript

Document Object Module DOM querySelector and querySelectorAll tutorial in JavaScript

Find Even and Odd Numbers with Loops tutorial in JavaScript