By 05/04/2016

How To Close Browser Window In JavaScript?

  • You can close current window of a web browser easily using JavaScript.
  • You need window.close() Or just close() built-in JavaScript functions to achieve this task.

Example:

<!Doctype html>
 <html>
 <head>
 <meta charset="UTF-8">
 <title>JavaScript close window</title>
 <Script>
 function closeWin(){
 close();
 }
 </script>
 </head>
 
 <body>
 <a href = "javascript:;" onclick = "closeWin()"> Close window by hyperlink </a> <br><br>
 <button type = "button" onclick="closeWin()"> Close window by button </button>
 </body>
 </html>






Posted in: HTML, JavaScript, Solutions

Comments are closed.

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .