Window blur() 方法

定义和用法
blur() 方法可把键盘焦点从顶层窗口移开。
语法
window.blur()
浏览器支持
除了 Opera 浏览器,所有主流浏览器都支持 blur() 方法。
实例
实例
保证新的窗口没有获得焦点(新窗口发送到后台):
<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>The new window.</p>");
myWindow.blur();
}
</script>
</head>
<body>
<input type="button" value="Open window" onclick="openWin()">
</body>
</html>
<head>
<script>
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>The new window.</p>");
myWindow.blur();
}
</script>
</head>
<body>
<input type="button" value="Open window" onclick="openWin()">
</body>
</html>
尝试一下 »

更多实例
