In JavaScript, the focusout event fires when an element has lost focus, after the blur event (MDN). The two differ in that focusoutbubbles, while blur does not. The opposite is focusin. The event object is a FocusEvent.
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for focusout. Start with this line.
JavaScript
el.addEventListener("focusout", fn)
Call
What it does
el.addEventListener("focusout", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("focusout", …) — no import required.
Library declarations
JavaScript
el.addEventListener("focusout", fn)
Parameters
Parameter
Description
FocusEvent
Required. Carries target and relatedTarget
Focusable control
Required. Input, button, link with tabindex, etc.
focusin
Optional. Setup when focus arrives
Return Value
Return Value
Description
*
Fires as an Element event (listener receives the Event object).
JavaScript Examples
Example 1 — Form Cleanup (MDN)
Highlight on focusin; clear on focusout when focus leaves.
FocusEvent.relatedTarget. For focusout, this is the element receiving focus (if any).
Tab between fields.to becomes the next control.
Click outside the page.relatedTarget may be null.
Use carefully. Always null-check before reading properties.
Compatibility
Browser Support
Element focusout is a standard UI Events focus event. MDN marks it Baseline Widely available since March 2017 — safe for everyday use in modern browsers.
✓ Baseline Widely available
Element focusout
Bubbling FocusEvent after blur — ideal for form-wide leave-focus cleanup.
WideBaseline
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
focusoutWidely available
Bottom line: Prefer focusout for parent delegation. Use blur when you only care about that element. Pair with focusin for enter/leave UI.
Frequently Asked Questions
It fires when an element has lost focus, after the blur event (MDN). Unlike blur, focusout bubbles, so you can listen on a parent and still hear when child controls lose focus.
No. MDN marks Element focusout as Baseline Widely available (since March 2017). It is not Deprecated, Experimental, or Non-standard.
Both fire when an element loses focus. blur does not bubble; focusout does, and it fires after blur. For form-wide cleanup, focusout is usually simpler.
A FocusEvent (inherits from UIEvent and Event). relatedTarget is the element that is receiving focus, if any.
No. MDN states the focusout event is not cancelable.
focusin — it fires when the element receives focus (after focus) and also bubbles.