javascript close window
window.close();//closes the current browser tab<!DOCTYPE html>
<html>
<body>
<button onclick="openWin()">Open "myWindow"</button>
<button onclick="closeWin()">Close "myWindow"</button>
<script>
var myWindow;
function openWin() {
myWindow = window.open("", "myWindow", "width=200,height=100");
myWindow.document.write("<p>This is 'myWindow'</p>");
}
function closeWin() {
myWindow.close();
}
</script>
</body>
</html>
Also in JavaScript:
- how to create angular project in visual studio code windows 10
- sum all fields in nested json logstash
- how to pass dynamic string in string javascript
- javascript modify href attr
- javascript after 2 months date find
- how to check if object exists in javascript
- js yesterday date
- javascript add days to date
- material ui icon button
- how to use fetch() to fetch an image from database in js
- Javascript compare two arrays
- open modal window at present cursor position javascript
- js check if attribute exists
- firebase timestamp to date angular
- how to trim the file name when length more than 10 in angular
- update cypress
- take a screen shot of a image within a div using js
- jsdoc optional param
- how to make a deck of cards in javascript
- react proxy error: could not proxy request from localhost:3000 to http localhost:5000 econnreset
- cordova delete cache
- get input value on keypress jquery
- express js sample project
- nodejs fs delete non empty directory