Answers for "javscript close window"

0

html close window button

<button type="button" onclick="javascript:window.close()"> Name </button>
Posted by: Guest on November-16-2020
6

javascript close window

<!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>
Posted by: Guest on April-06-2020

Browse Popular Code Answers by Language