The focusout event fires after blur when an element loses focus—and unlike blur, it bubbles. Learn onfocusout, form cleanup, relatedTarget, the focusin pair, and five try-it labs.
01
Kind
Instance event
02
Type
FocusEvent
03
Bubbles?
Yes
04
Handler
onfocusout
05
Pair
focusin
06
Status
Limited availability
Fundamentals
Introduction
blur is perfect when you attach a listener directly to one control. When you want one listener on a form or dialog to react to every child that loses focus, focusout is the event designed for that job because it bubbles.
It fires after blur. Its opposite is focusin (which bubbles after focus). MDN marks focusout as Limited availability (not Baseline)—still widely useful, but always verify support for your audience.
💡
Beginner tip
Use focusout to clear highlights, hide hints, or run “validate when the user leaves the field” logic for many inputs with a single parent listener.
Concept
Understanding focusout
An instance event that answers: “Did this element (or a descendant) just lose focus?” when you listen on an ancestor.
Fires after blur when an element loses focus.
Bubbles — ideal for event delegation on forms and containers.
Not cancelable — you cannot keep focus by calling preventDefault().
FocusEvent — relatedTarget is the element receiving focus (if any).
Handler — onfocusout or addEventListener("focusout", ...).
Limited availability on MDN (not Baseline)—test carefully.
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
The element losing focus (often a child of your listener)
currentTarget
The element you attached the listener to (e.g. the form)
relatedTarget
The element receiving focus, if any (may be null)
bubbles
true for focusout
cancelable
false — not cancelable
Sequence
🔁 Event Order (A → B)
When focus moves from element A to element B, browsers typically dispatch:
blur on A
focusout on A (bubbles)
focus on B
focusin on B (bubbles)
So cleanup for A usually happens before setup for B. MDN notes that the UI Events specification describes an order that can differ from what current browsers implement—avoid fragile assumptions beyond this common pattern.
Compare
⚖️ focusout vs blur
Topic
blur
focusout
When
Element loses focus
Same moment, after blur
Bubbles?
No
Yes
Best for
Listener on the element itself
Delegation on a parent
Opposite pair
focus
focusin
relatedTarget
Element receiving focus (if any)
Element receiving focus (if any)
MDN status
Baseline Widely available
Limited availability (not Baseline)
🔔
Fallback idea
If you must support environments where focusout is awkward, you can still delegate with addEventListener("blur", handler, true) (capture phase). Prefer focusout when it is available and clearer.
focusout is marked Limited availability on MDN (not Baseline). Logos use the shared browser-image-sprite.png sprite from this project. It is widely used for form cleanup—still verify support for your audience, and keep capture-phase blur as a mental fallback.
✓ Limited availability
Element focusout
Bubbling blur signal for parent listeners; confirm support in your target browsers.
LimitedNot Baseline
Google ChromeSupported (check BCD for edge cases)
Supported
Mozilla FirefoxSupported in modern versions
Supported
Apple SafariSupported in modern versions
Supported
Microsoft EdgeSupported · Chromium
Supported
OperaSupported · Modern versions
Supported
Internet ExplorerLegacy support existed; prefer modern browsers
Legacy
focusoutLimited
Bottom line: Prefer focusout for form cleanup when available; pair with focusin and test carefully.
Wrap Up
Conclusion
focusout is the bubbling “lost focus” signal that follows blur. Use it for form-wide cleanup and soft validation, pair it with focusin, and remember MDN lists it as Limited availability.
Prefer addEventListener("focusout", ...) on parents for cleanup
Pair with focusin for highlight / hint UX
Filter event.target when you only care about inputs
Null-check event.relatedTarget
Test browsers you support (Limited availability)
❌ Don’t
Expect bubble-phase blur on a form to see child fields
Rely on preventDefault() to keep focus
Leave focus styles stuck after the user leaves a field
Assume Baseline Widely available status
Overwrite onfocusout if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about focusout
After blur—bubbles; ideal for form cleanup with focusin.
5
Core concepts
💡01
After blur
lost focus
Trigger
📄02
FocusEvent
relatedTarget = next
API
📤03
Bubbles
unlike blur
Key
⇄04
Pair focusin
highlight + clear
Pattern
🎯05
Limited avail.
not Baseline
Status
❓ Frequently Asked Questions
It fires when an element has lost focus, after the blur event. Unlike blur, focusout bubbles, so you can listen on a parent and still hear when child controls lose focus.
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It has Limited availability (not Baseline), so always test the browsers you care about.
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 the simpler choice.
A FocusEvent (inherits from UIEvent and Event). relatedTarget is the element receiving focus, if any.
No. The focusout event is not cancelable.
focusin — it fires when the element receives focus (after focus) and also bubbles.
Did you know?
For focusout, relatedTarget points to where focus is going. For focusin, it points to where focus came from. Same property name—opposite direction.