Window blur() Method - Assure that the new window GETS focus and send the new window to the front - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window blur

Description

Window blur() Method - Assure that the new window GETS focus and send the new window to the front

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

</body>
</html>

Related Tutorials