Edit This Code:
<!DOCTYPE html>
<html>
<head>
<script>
var myWindow;
function openWin() {
    myWindow = window.open("", "", "width=400, height=200");
    myWindow.blur();
}
function blurWin() {
    myWindow.blur();
}
function focusWin() {
    myWindow.focus();
}
</script>
</head>
<body>

<input type="button" value="Open new window" onclick="openWin()">
<input type="button" value="Blur new window" onclick="blurWin()">
<input type="button" value="Focus new window" onclick="focusWin()">

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy