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>