Window blur() Method

Definition and Usage

blur() The method removes the focus from the window.

focus() The method sets the focus to the window.

Note:blur() The method sends a request to put the window in the background. Due to different user settings, it may not work as expected.

See also:

focus() Method

Instance

Example 1

Open a new window and blur the focus:

const myWindow = window.open("", "", "width=200, height=100");
myWindow.blur();

Try It Yourself

Example 2

Open a new window and set the focus:

const myWindow = window.open("", "", "width=200, height=100"); myWindow.focus();

Try It Yourself

Syntax

window.blur()

Parameter

None.

Return Value

None.

Browser Support

All Browsers Support blur():

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support