.focusout() is jQuery’s legacy shorthand for binding or triggering the bubbling focusout event — when an element or a descendant loses focus. Binding is deprecated since 3.3; modern code uses .on("focusout") / .trigger("focusout").
Remember
// Legacy (still works; bind form deprecated since 3.3)
$("p").focusout(function () {
// this <p> or a nested input lost focus
});
// Modern replacements
$("p").on("focusout", handler); // bind
$("p").trigger("focusout"); // fire handlers
// Better for dynamic forms (delegation)
$("#form").on("focusout", "input", handler);
Click #fire → no-arg .focusout() runs
Bound handler updates #out
Keyboard focus may stay on the button
How It Works
Bind. The handler is registered on #box.
Click. No-arg .focusout() triggers the event.
Handlers. Bound focusout callbacks run immediately.
Caret. To move focus away, use .trigger("blur") on an input.
Example 4 — Migrate to .on("focusout")
Both bind the same event — .on() is the recommended API for new code.
jQuery
$("#legacy").focusout(function () {
$("#out").text("Legacy: .focusout(fn) — deprecated since 3.3.");
});
$("#modern").on("focusout", function () {
$("#out").text("Modern: .on('focusout', fn) — use this for new code.");
});
Rule. Use focusout (or .on("focusout")) for parents.
Edge Cases & Pitfalls
Watch for these when reading or migrating legacy .focusout() code.
deprecated
Bind form deprecated since 3.3
Still works in jQuery 3.x, but new code should use .on("focusout").
delegation
No built-in delegation
.focusout(fn) cannot target future elements. Use $("#form").on("focusout", "input", fn).
trigger
No-arg .focusout() ≠ move caret
It runs handlers. To move keyboard focus away, call .trigger("blur") on a visible input.
bind vs trigger
.focusout(fn) ≠ .focusout()
With a function it binds; with no args it triggers. Always check the parentheses.
Compatibility
Browser Support
The underlying focusout event is a standard DOM event with bubbling. The .focusout() method is a jQuery API available since 1.0 (eventData since 1.4.3). Binding via .focusout(handler) is deprecated since 3.3 but still functional in jQuery 3.x.
✓ Deprecated · jQuery 3.3
jQuery .focusout()
Works in jQuery 1.x–3.x. Prefer .on('focusout') / .trigger('focusout') for new projects. Use parents to catch nested leave-focus.
100%With jQuery loaded
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.focusout()Legacy API
Bottom line: Safe in legacy projects. Migrate bindings to .on('focusout') and triggers to .trigger('focusout') when you touch form scripts.
Analysis
Performance Notes
Approach
Cost
Best for
One .on("focusout") on a form
Cheap
Many nested fields, validation
Delegated .on("focusout", "input", fn)
Cheap
Dynamic / AJAX fields
Heavy work on every focusout
Expensive
Avoid — keep handlers light
The shorthand and .on("focusout") cost the same for a single bind. Prefer .on() for clarity and delegation. Keep leave callbacks light.
Remember
Key Takeaways
Role: legacy bind/trigger for bubbling focusout.
Migrate:.on("focusout", fn) and .trigger("focusout").
Delegation: only available via .on("focusout", selector, fn).
One line:.focusout() is deprecated sugar for .on("focusout") / .trigger("focusout") — migrate when you touch the file.
Frequently Asked Questions
The .focusout() method has two roles. With a handler — .focusout(handler) or .focusout(eventData, handler) — it binds a function that runs when the matched element or any descendant loses focus (bubbles). With no arguments — .focusout() — it triggers the focusout event on each matched element. Binding has been part of jQuery since 1.0 and is deprecated since 3.3.
Yes. The binding signatures .focusout(handler) and .focusout(eventData, handler) are deprecated since jQuery 3.3. Use .on("focusout", handler) instead. The no-argument .focusout() trigger still works, but .trigger("focusout") is clearer. Legacy code continues to run in jQuery 3.x.
.focusout(handler) registers a callback and does not fire immediately. .focusout() with no arguments triggers the focusout event — the same as .trigger("focusout"). Check whether parentheses contain a function before reading legacy code.
Replace .focusout(fn) with .on("focusout", fn). Replace .focusout(data, fn) with .on("focusout", data, fn). Replace no-arg .focusout() with .trigger("focusout"). Cleanup with .off("focusout"). Under the hood, .focusout(handler) already delegates to .on("focusout").
.blur() binds or triggers the non-bubbling blur event on the matched element. .focusout() binds or triggers the bubbling focusout event — better for parent containers that validate when nested inputs lose focus. To move keyboard focus away, use .trigger("blur") on the current input.
No. Direct .focusout(fn) only binds to elements that already match. For dynamic fields, use .on("focusout", "input", fn) on a parent. That is one reason to prefer .on() over the shorthand.