Window:blur() 方法

已弃用: 不再推荐使用该特性。虽然一些浏览器仍然支持它,但也许已从相关的 web 标准中移除,也许正准备移除或出于兼容性而保留。请尽量不要使用该特性,并更新现有的代码;参见本页面底部的兼容性表格以指导你作出决定。请注意,该特性随时可能无法正常工作。

Window.blur() 方法不起任何作用。

备注: 从历史上看,这种方法在编程上相当于用户将焦点从当前窗口中移开。由于某些恶意网站滥用此功能,这种行为已被移除。在 Firefox 中,你可以通过设置 dom.disable_window_flip 首选项来启用旧的行为。

语法

js
blur()

参数

无。

返回值

无(undefined)。

示例

js
window.blur();

规范

Specification
HTML
# dom-window-blur

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
blur
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Deprecated. Not for use in new websites.