Open a new window and blur it:
const myWindow = window.open("", "", "width=200, height=100");
myWindow.blur();
Try it Yourself »
Open a new window and set focus to it:
const myWindow = window.open("", "", "width=200, height=100"); myWindow.focus();
Try it Yourself »
The blur()
method removes focus from a window.
The focus()
method sets focus to a window.
The blur()
method makes a request to bring a window to the background.
It may not work as you expect, due to different user settings.
window.blur()
None |
NONE |
blur()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!