Javascript examples for Browser Object Model:Window blur
The blur() method removes focus from the current window.
None
No return value
The following code shows how to Assure that the new window does NOT get focus
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w w w . j a va2 s. c om*/ var myWindow = window.open("", "", "width=200, height=100"); myWindow.document.write("<p>A new window!</p>"); myWindow.blur(); } </script> </body> </html>