-----034-Window-Focus.html-----
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>标题</title> </head> <body> <script type="text/javascript"> function openNew() { wnd = window.open("", "", "width=200 height=160"); wnd.document.write("新窗口获得焦点"); wnd.focus();//获取焦点 // wnd.blur();//失去焦点 } </script> <button onclick="openNew()">创建新窗口并获得焦点</button> </body> </html>