Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Close popup window

<html>
<script>
var newWindow;

function openWindow() {
  newWindow = window.open("", "myWindow", "width=200,height=100");
  newWindow.document.write('<a href="javascript:window.close();" class="video-close">Close this window</a>');
}

function closeWindow() {
  newWindow.close();
}
</script>
<h3 style="color:brown"> Close Window Example </h3>
<body>
<button onclick="openWindow()">Open New Window</button>
<br><br>
<button onclick="closeWindow()">Close New Window </button>

</body>
</html>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Close #popup #window
ADD COMMENT
Topic
Name
4+9 =