1<html>
2<script>
3var newWindow;
4
5function openWindow() {
6 newWindow = window.open("", "myWindow", "width=200,height=100");
7 newWindow.document.write('<a href="javascript:window.close();" class="video-close">Close this window</a>');
8}
9
10function closeWindow() {
11 newWindow.close();
12}
13</script>
14<h3 style="color:brown"> Close Window Example </h3>
15<body>
16<button onclick="openWindow()">Open New Window</button>
17<br><br>
18<button onclick="closeWindow()">Close New Window </button>
19
20</body>
21</html>
22