epsooraj

open close tab

May 23rd, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.41 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <body>
  4.     <p>Click the button to open a new browser window.</p>
  5.     <button onclick="myFunction()">Try it</button>
  6.     <button onclick="closeFunction()">Close</button>
  7.     <script>
  8.       function myFunction() {
  9.         myWindow = window.open("https://www.google.com");
  10.       }
  11.      
  12.       function closeFunction() {
  13.         myWindow.close();
  14.       }
  15.     </script>
  16.   </body>
  17. </html>
Add Comment
Please, Sign In to add comment