Focus 焦点定位

来源:互联网 发布:纽曼纽扣淘宝自动重启 编辑:程序博客网 时间:2024/04/30 20:43

<html>
<head>
<title>焦点定位</title>
<script LANGUAGE="Javascript">
var newWindow = null
function makeNewWindow(){
    if (!newWindow || newWindow.closed)
    {
        newWindow = window.open("","","width=150,height=150");
        var newContent = "<html><head><title>新建窗口</title></head>";
        newContent += "<body bgColor='blue'><H1>一个新的窗体</H1>";
        newContent += "<form><INPUT TYPE='button' VALUE='切换一个新的窗体' onClick='self.opener.focus()'><BR><BR>";
        newContent += "<form><INPUT TYPE='button' VALUE='返回上一窗体' onClick='self.blur()'>";
        newContent += "</form></body></html>";
        newWindow.document.write(newContent);
        newWindow.document.close();
    }
    else
    {
        newWindow.focus();
    }
}
</script>
</head>
<body>
<form>
<INPUT TYPE="button" NAME="newOne" VALUE="打开新窗体" onClick="makeNewWindow()">
</form>
</body>
</html>

原创粉丝点击