This is 'My Window'
"); myWindow.focus(); } [Try it yourself Β»](#) * * *  ## More Examples (#) * * Window Object](#)Met Win Focus
# Window focus() Method
[ Window Object](#)
* * *
## Definition and Usage
The focus() method sets focus to the current window, which means bringing the window to the front (closer to the screen).
## Syntax
window.focus()
* * *
## Browser Support
| Method | | | | | |
| --- | --- | --- | --- | --- | --- |
| focus() | Yes | Yes | Yes | Yes | Yes |
* * *
## Example
## Example
Ensure the new window gets focus (bring it to the front):
function openWin(){myWindow=window.open('','','width=200,height=100'); myWindow.document.write("
YouTip