Window focus() Method - Assure that the new window does NOT get focus and send the new window to the background - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window focus

Description

Window focus() Method - Assure that the new window does NOT get focus and send the new window to the background

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/*from   w  ww . j a  v a2 s .com*/
    var myWindow = window.open("", "", "width=200, height=100");
    myWindow.document.write("<p>A new window!</p>");
    myWindow.blur();
}
</script>

</body>
</html>

Related Tutorials