被几个事件搞晕了头- <html>
-
- <head>
- <hta:Application
- ID = "oHTA"
- ContextMenu = "No"
- Border = "None"
- ShowInTaskBar = "No"
- ApplicationName = "192.168.0.251"
- SingleInstance = "Yes"
- WindowState = "Maximize"
- Version = "1.5"
- Scroll = "No"
- >
-
- <script language=vbscript>
- Sub focus()
- userid.focus()
- xx.innerText = "活动"
- End Sub
- Sub blur()
- xx.innerText = "不活动"
- End Sub
- Sub check()
- xx.innerText = "不活动"
- End Sub
- </script>
-
- </head>
-
- <body onfocus="focus()" onblur="blur()" style="background:#80BFFF;">
-
- <div style="position:absolute;left:40%;top:30%;">
- <label for="userid" style="width:60px;">卡号</label>
- <input type="text" id="userid" style="width:200px;" />
- <br /><br />
- <label for="userpassword" style="width:60px;">口令</label>
- <input type="password" id="userpw" style="width:200px;" />
- <br /><br />
- <label for="adminpassword" style="width:60px;">管理员</label>
- <input type=password id="adminpw" style="width:200px;" />
- <br /><br />
- <button style="position:absolute;right:0px;" onclick="check()">确定</button>
- <br /><br /><br />
- <label id="xx" style="width:260px;color:red;font-Weight:bold;"></label>
- </div>
-
-
- </body>
-
- </html>
复制代码 意图:当窗口被关闭或被最小化时,或按开始菜单,窗口不活动时,触发事件
防止别人跳过输入窗口 |