Window blur()
Example
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 »
Definition and Usage
The blur()
method removes focus from a window.
The focus()
method sets focus to a window.
Note
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.
See Also:
Syntax
window.blur()
Parameters
None |
Return Value
NONE |
Browser Support
blur()
is supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |