Window.blur() is a deprecated method that currently does nothing(MDN). Historically it tried to shift focus away from the current window; that behavior was removed because sites abused it.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call window.blur. Start with this line.
JavaScript
window.blur()
Call
What it does
window.blur()
Primary signature.
window.blur(...)
Call with the arguments your case needs.
Built into the browser. Call window.blur(...) (or the global blur(...)) — no import required.
Library declarations
JavaScript
window.blur()
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Always undefined
JavaScript Examples
Example 1 — Call window.blur()
Invoke the deprecated method. Modern browsers keep the tab focused.
JavaScript
window.blur();
// same as: blur();
console.log("blur() called — expect no tab change");
No success flag. You cannot detect a focus flip from the return value.
Example 3 — Listen for the blur Event
React when the user leaves the tab — the practical pattern for apps.
JavaScript
window.addEventListener("blur", () => {
console.log("Window lost focus");
});
window.addEventListener("focus", () => {
console.log("Window gained focus");
});
// Switch to another tab, then come back, to see both logs.
Focus an input. Keyboard focus moves into the field.
Call input.blur(). The field loses focus — this is the everyday API.
Call window.blur(). No tab change in modern browsers.
Rule of thumb. Form fields → element APIs; tab leave → events / Visibility API.
Compatibility
Browser Support
Window.blur() is marked Deprecated on MDN. The method exists widely but is a no-op in modern browsers. Prefer events / Visibility API for real features.
✓ Deprecated · No-op
blur()
Callable everywhere — but it does not unfocus the window in modern engines.
0%Useful focus control
ChromePresent · no-op
Deprecated
EdgePresent · no-op
Deprecated
FirefoxPresent · no-op*
Deprecated
SafariPresent · no-op
Deprecated
OperaPresent · no-op
Deprecated
HTML elementLegacy only
Bottom line: Do not build features on window.blur(). Use the window blur/focus events or visibilitychange instead.
Frequently Asked Questions
According to MDN, Window.blur() does nothing in modern browsers. The call is still available, returns undefined, and does not move focus away from the tab.
Yes. MDN marks Window.blur() as Deprecated. Avoid it in new projects. It is not Experimental or Non-standard.
Hostile sites abused programmatic focus flipping. Browsers removed the ability for scripts to unfocus the current window for security and usability.
No. window.blur() targets the browsing window (and is a deprecated no-op). element.blur() removes keyboard focus from a specific HTML control and is still useful.
Listen for the window blur and focus events, or use the Page Visibility API (document.visibilitychange / document.hidden). Do not rely on window.blur() to force an unfocus.
No parameters. The return value is always undefined.