HTML DOM focus() Method
Complete Window Object Reference
Definition and Usage
The focus() method sets focus to the current window.
Syntax
Example
The following example assures that the new window gets focus:
<html>
<body>
<script type="text/javascript">
myWindow=window.open('','','width=200,height=100')
myWindow.document.write("This is 'myWindow'")
myWindow.focus()
</script>
</body>
</html>
|
Try-It-Yourself Demos
Give focus to
a new window
Remove focus
from a new window
Complete Window Object Reference
|