Search
 
SCRIPT & CODE EXAMPLE
 

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: axios post 
Javascript :: javascript play pause button 
Javascript :: react input number validation 
Javascript :: remove char from string js 
Javascript :: to lowercase js 
Javascript :: javascript is array a subset of array 
Javascript :: distance to km javascript 
Javascript :: rounding number to x decimals javascript 
Javascript :: let in javascript 
Javascript :: css canvas set aspect ratio 
Javascript :: how to check value is array or not in javascript 
Javascript :: reload react native app 
Javascript :: javascript two digit number 
Javascript :: data not write in file node js 
Javascript :: how to add custom font to react project 
Javascript :: event delegation in javascript 
Javascript :: js replace multiple 
Javascript :: using multiparty with node js express 
Javascript :: nested object javascript 
Javascript :: urlencoded limit 
Javascript :: prisma seed 
Javascript :: json placholder 
Javascript :: Javascript replace div content onclick a button 
Javascript :: setinterval js 
Javascript :: jquery form data 
Javascript :: Simple code example of adding two numbers in javascript 
Javascript :: add regexp to antd 
Javascript :: get element innerhtml jquery 
Javascript :: on() jquery 
Javascript :: moment get timezone 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =