The blur event fires when an element loses focus. Learn addEventListener vs onblur, why blur does not bubble, how focusout and capture help with delegation, FocusEvent.relatedTarget, and five try-it labs.
01
Kind
Instance event
02
Type
FocusEvent
03
Bubbles?
No
04
Cancelable?
No
05
Handler
onblur
06
Status
Baseline widely available
Fundamentals
Introduction
Focus means which control is ready for keyboard input. When the user tabs or clicks away from a field, that field blurs—it loses focus—and the blur event fires on that element.
The opposite event is focus (gains focus). A closely related bubbling event is focusout, which is often better for listening on a parent container.
💡
Beginner tip
Prefer addEventListener("blur", ...) on the element itself. If you need one listener for many children, use focusout or listen to blur in the capture phase.
Concept
Understanding blur
An instance event that answers: “Did this element just lose focus?”
Fires when the element loses focus (click/tab away, hide, or remove in some browsers).
Does not bubble — use focusout or capture for delegation.
Not cancelable — you cannot stop focus from leaving via blur.
FocusEvent — check relatedTarget for the new focus target.
Baseline Widely available on MDN (since July 2015).
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
blur is marked Baseline Widely available on MDN (since July 2015). Logos use the shared browser-image-sprite.png sprite from this project. Still watch small differences when removing a focused node from the document.
✓ Baseline · Widely available
Element blur
Works across modern desktop and mobile browsers when an element loses focus.
100%Widely available
Google ChromeSupported · Desktop & Android
Full support
Mozilla FirefoxSupported · Desktop & Android
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
OperaSupported · Modern versions
Full support
Internet ExplorerSupported (legacy)
Supported
blurBaseline
Bottom line: Listen on the element for blur, or use focusout / capture when you need parent-level delegation.
Wrap Up
Conclusion
blur is the standard “this element just lost focus” signal. Pair it with focus for enter/leave styling, use relatedTarget when you care where focus went, and reach for focusout or capture when you need delegation.
Prefer addEventListener("blur", ...) on the element
Use focusout for parent-level leave-focus logic
Pair with focus / focusin for enter/leave UI
Read relatedTarget when tracking focus movement
Test keyboard Tab paths, not only mouse clicks
❌ Don’t
Expect blur to bubble like click
Call preventDefault() hoping to keep focus
Assume removing a focused node always fires blur (Firefox differs)
Confuse Element blur with Window blur
Overwrite onblur if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about blur
Focus left this element—style, validate, or clean up.
5
Core concepts
👁️01
Lost focus
opposite of focus
Event
📄02
FocusEvent
relatedTarget
API
🚫03
No bubble
use focusout
Caveat
🛑04
Not cancelable
cannot block leave
Rule
🎯05
Baseline
widely available
Compat
❓ Frequently Asked Questions
The blur event fires when an element has lost focus. The opposite event is focus, which fires when an element receives focus.
No. MDN marks Element blur as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
No. blur does not bubble. The related focusout event that follows does bubble. For event delegation you can use focusout, or listen to blur with useCapture set to true.
No. The blur event is not cancelable. You cannot prevent focus from leaving with preventDefault() on blur.
A FocusEvent (inherits from UIEvent). A useful property is relatedTarget — the element receiving focus, if any.
Besides clicking or tabbing elsewhere, focus can leave if a style that prevents focus is applied (for example hidden), or if the element is removed from the document. Browser behavior differs when a focused element is removed: Chromium often fires blur; Firefox may not.
Did you know?
While a blur handler runs, document.activeElement is not the same in every browser. Some engines briefly point at body; older IE pointed at the element that will receive focus. Prefer event.target and event.relatedTarget inside the handler.