Window blur() 方法

定義和用法
blur() 方法可把鍵盤焦點從頂層窗口移開。
語法
window.blur()
瀏覽器支持
除了 Opera 瀏覽器,所有主流瀏覽器都支持 blur() 方法。
實例
實例
保證新的窗口沒有獲得焦點(新窗口發(fā)送到后臺):
<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>
嘗試一下 ?

更多實例

更多建議: