jQuery .focusout() Method

Beginner
⚠️ Deprecated since 3.3
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Form events

What You’ll Learn

The .focusout() method is jQuery’s legacy shorthand for binding and triggering the focusout event. This tutorial covers .focusout(handler) since 1.0, .focusout(eventData, handler) since 1.4.3, no-argument .focusout() as a trigger, migration to .on("focusout") and .trigger("focusout"), and why the binding form is deprecated since jQuery 3.3. For the modern focusout event API, see the jQuery focusout event tutorial.

01

.focusout(fn)

Bind handler

02

eventData

Since 1.4.3

03

.focusout()

Trigger event

04

.on()

Modern bind

05

.trigger()

Modern fire

06

Deprecated

Since 3.3

Introduction

Before jQuery 1.7 unified events with .on() and .off(), every common event had a matching shorthand — .focusout(), .focus(), .blur(), and more. The .focusout() method let you react when focus leaves an element or any descendant in one call: $("#form").focusout(function(){ ... }). It remains in jQuery 3.x for backward compatibility but is marked deprecated.

Understanding .focusout() matters when reading older parent-form delegation code. The method does two distinct jobs: with a function argument it binds; with no arguments it triggers. Modern jQuery splits those roles — .on("focusout", handler) for binding and .trigger("focusout") for firing.

Understanding the .focusout() Method

The official jQuery API describes .focusout() as a way to bind an event handler to the focusout event, or trigger that event on an element. When you pass a handler, jQuery registers it on each matched element and calls it when the element or any nested descendant loses focus — the bubbling focusout event that .on("focusout") handles today.

When you call .focusout() with no arguments, jQuery synthetically fires the focusout event on each matched element. Bound handlers run — useful for forcing validation before submit. To move keyboard focus away from an input, use .trigger("blur") instead; the browser fires both blur and focusout automatically.

⚠️
Deprecated since jQuery 3.3

Do not use .focusout(handler) or .focusout(eventData, handler) in new code. Replace them with .on("focusout", handler) or .on("focusout", eventData, handler). Replace no-argument .focusout() with .trigger("focusout"). For bubbling semantics, delegation, and the full modern guide, read the jQuery focusout event tutorial.

📝 Syntax

The .focusout() method has three signatures from the official jQuery API. The binding forms are deprecated; the trigger form remains valid but .trigger("focusout") is preferred:

1. Bind a handler — .focusout( handler ) (since 1.0, deprecated 3.3)

jQuery
.focusout( handler )
  • handler — function executed each time focusout fires: function( event ) { ... }.
  • Returns the jQuery object for chaining.
  • Modern replacement: .on( "focusout", handler ).

2. Bind with eventData — .focusout( [eventData], handler ) (since 1.4.3, deprecated 3.3)

jQuery
.focusout( [eventData], handler )
  • eventData — optional object available in the handler as event.data.
  • Modern replacement: .on( "focusout", eventData, handler ).

3. Trigger the event — .focusout() (since 1.0)

jQuery
.focusout()
  • No arguments — triggers focusout on every matched element.
  • Runs bound focusout handlers (including on ancestors when bubbled).
  • To move keyboard focus, use .trigger("focus") on the target input.
  • Preferred replacement: .trigger( "focusout" ).

Official jQuery API migration note

jQuery
// Deprecated binding
$( "#target" ).focusout( function() {
  alert( "Handler for `focusout` called." );
} );

// Modern binding
$( "#target" ).on( "focusout", function() {
  alert( "Handler for `focusout` called." );
} );

// Deprecated trigger
$( "#target" ).focusout();

// Modern trigger
$( "#target" ).trigger( "focusout" );

Return value

  • All .focusout() signatures return the original jQuery object for chaining.
  • Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).

⚡ Quick Reference

GoalLegacy (.focusout)Modern replacement
Bind focusout on parent$("#form").focusout(fn)$("#form").on("focusout", fn)
Pass data to handler$("#form").focusout({ rule: "required" }, fn)$("#form").on("focusout", { rule: "required" }, fn)
Trigger focusout programmatically$("#form").focusout()$("#form").trigger("focusout")
Move focus away from input$("#login").trigger("blur") — fires blur and focusout
Remove focusout handlers$("#form").off("focusout")
Delegated filter on inputs$("#form").on("focusout", "input", fn) — not available via .focusout()
Enter pair (bubbles)$("#form").on("focusin", "input", fn)

📋 .focusout() vs .on("focusout") vs .trigger("focusout") vs .off("focusout")

Four related APIs — know which one binds, which one fires, and which one removes handlers.

.focusout()
deprecated

Legacy bind (.focusout(fn)) or trigger (.focusout()) — use modern APIs for new code

.on("focusout")
bind

Modern binding since 1.7 — supports eventData and delegation on dynamic forms

.trigger("focusout")
fire

Programmatically run handlers — clearer than no-arg .focusout()

.off("focusout"
remove

Unbind handlers — pair with .on("focusout") when cleaning up or in SPAs

Examples Gallery

Five examples cover binding, eventData, triggering, migration from .focusout() to .on("focusout"), and method chaining. Use the Try-it links to run each snippet in the browser. Remember: binding with .focusout(handler) is deprecated — these demos show legacy syntax you will encounter in older code.

📚 Binding & Triggering

Legacy .focusout() signatures for binding handlers and firing events programmatically.

Example 1 — Official Demo: .focusout() vs .blur() on Paragraphs

Legacy parent binding — the focusout counter increases when focus leaves nested inputs; the blur counter does not bubble.

jQuery
var focusout = 0, blur = 0;

$( "p" )
  .focusout( function() {
    focusout++;
    $( "#focus-count" ).text( "focusout fired: " + focusout + "x" );
  } )
  .blur( function() {
    blur++;
    $( "#blur-count" ).text( "blur fired: " + blur + "x" );
  } );
Try It Yourself

How It Works

.focusout(fn) on the paragraph catches focus leaving any descendant. jQuery routes this to .on("focusout", fn). The paired .blur(fn) on the same <p> does not run for nested inputs because blur does not bubble.

Example 2 — Pass eventData with .focusout(eventData, handler)

Since jQuery 1.4.3, pass a validation rule object before the handler on a parent form — it arrives as event.data.

jQuery
$( "#profile-form" ).focusout( { rule: "required" }, function( event ) {
  if ( $( event.target ).is( "input" ) ) {
    var empty = $( event.target ).val().trim().length === 0;
    $( event.target ).toggleClass( "required-missing", empty );
  }
  $( "#out" ).text( "Focusout on form | rule: " + event.data.rule );
} );
Try It Yourself

How It Works

Binding .focusout({ rule: "required" }, fn) on the form passes event.data to the handler whenever focus leaves the form or any nested field. Because focusout bubbles, one parent binding covers all inputs.

Example 3 — Trigger Focusout with No-Argument .focusout()

Calling .focusout() without a handler fires the focusout event programmatically on the matched element.

jQuery
var count = 0;

$( "#target" ).focusout( function() {
  count++;
  $( "#out" ).text( "Target focusout handler fired (count: " + count + ")" );
} );

$( "#fire" ).click( function() {
  $( "#target" ).focusout();
} );
Try It Yourself

How It Works

The first .focusout(function(){ ... }) binds a handler on #target. The button calls $("#target").focusout() with no arguments — that synthetically fires focusout. Replace with $("#target").trigger("focusout") for clarity.

📈 Migration & Chaining

Compare legacy and modern APIs, and chain after .focusout(handler).

Example 4 — Migration: .focusout(fn) vs .on("focusout", fn)

Both bind the same focusout event — .on() is the recommended API for new code.

jQuery
$( "#legacy" ).focusout( function() {
  $( "#out" ).text( "Legacy: .focusout(function(){ ... }) — deprecated since jQuery 3.3." );
} );

$( "#modern" ).on( "focusout", function() {
  $( "#out" ).text( "Modern: .on('focusout', function(){ ... }) — use this for new code." );
} );
Try It Yourself

How It Works

Under the hood, .focusout(fn) calls .on("focusout", fn). Migration is a straight rename with no behavior change for simple bindings. The advantage of .on() is delegation — $("#form").on("focusout", "input", fn) — which .focusout() cannot do.

Example 5 — Chaining After .focusout(handler)

.focusout(handler) returns the jQuery object — chain validate and mark-touched handlers on parent forms.

jQuery
$( "#form" )
  .focusout( function( event ) {
    if ( $( event.target ).is( "input" ) ) {
      var empty = $( event.target ).val().trim().length === 0;
      $( event.target ).toggleClass( "required-missing", empty );
      $( "#hint" ).text( empty ? "Field left empty." : "Field OK." ).show();
    }
  } )
  .focusout( function( event ) {
    if ( $( event.target ).is( "input" ) ) {
      $( event.target ).addClass( "touched" );
    }
  } );
Try It Yourself

How It Works

Multiple .focusout(fn) calls on the same element stack handlers — all run when focus leaves a descendant. Because each call returns the jQuery object, you can chain them fluently. The same chaining pattern works with .on("focusout", fn).

🚀 Common Use Cases

  • Reading legacy code — recognize $("#form").focusout(fn) as equivalent to .on("focusout", fn) in older form scripts.
  • Parent paragraph handler — legacy code binds $("p").focusout(fn) to react when nested inputs lose focus.
  • Form container binding$("#form").focusout(fn) validates fields on exit without per-input bindings.
  • Shared eventData$("#form").focusout({ rule: "required" }, fn) passes config to one parent handler.
  • Chained handlers — stacked .focusout(fn) calls validate and mark .touched on the form.
  • Maintaining WordPress themes — many admin and front-end scripts still use .focusout() — know how to migrate safely.

🧠 How .focusout() Routes Through jQuery

1

You call .focusout()

With a function argument, jQuery treats it as a bind request. With no arguments, it treats it as a trigger request.

dispatch
2

Bind path

.focusout(handler) delegates internally to .on("focusout", handler) — the handler is stored in jQuery’s event system.

.on("focusout")
3

Trigger path

No-arg .focusout() delegates to .trigger("focusout") — bound handlers run when focus leaves (including descendants).

.trigger("focusout")
4

jQuery object returned

Both paths return the original collection for chaining — .focusout(fn).addClass("watched") works the same as .on("focusout", fn).addClass("watched").

📝 Notes

  • Deprecated since jQuery 3.3 — do not use .focusout(handler) or .focusout(eventData, handler) in new code. Use .on("focusout") instead.
  • Bind with .focusout(handler) since jQuery 1.0; eventData form since 1.4.3.
  • No-argument .focusout() triggers the event since jQuery 1.0 — prefer .trigger("focusout").
  • .focusout(handler) binds on matched elements — for selector filtering use .on("focusout", "input", fn).
  • Native focusout bubbles — that is why parent .focusout(fn) catches nested input blur.
  • Pair with focusin on the same parent for complete enter/exit tracking.
  • Remove handlers with .off("focusout") — not by calling .focusout(undefined).
  • For the full modern focusout event guide — delegation and dynamic forms — see the jQuery focusout event tutorial.

Browser Support

The underlying focusout event is a standard DOM focus event supported in every browser jQuery targets. The .focusout() method itself is a jQuery API — it works in jQuery 1.x, 2.x, and 3.x. Binding via .focusout(handler) is deprecated since 3.3 but still functional; triggering via no-arg .focusout() also remains supported.

jQuery 1.0+

jQuery .focusout() method

Supported across all jQuery versions you are likely to maintain. Deprecated binding since 3.3 — use .on('focusout') for new projects. Native equivalent for binding: element.addEventListener('focusout', fn). Use .trigger('blur') to move keyboard focus away.

100% With jQuery loaded
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
.focusout() Legacy API

Bottom line: Safe in legacy jQuery projects. Migrate bindings to .on('focusout') and triggers to .trigger('focusout') when updating parent-form validation code.

Conclusion

The jQuery .focusout() method is the legacy shorthand for binding and triggering focusout handlers. Use .focusout(handler) or .focusout(eventData, handler) to bind — both deprecated since jQuery 3.3. Use no-argument .focusout() to trigger — equivalent to .trigger("focusout").

For new code, prefer .on("focusout", fn) for binding and .trigger("focusout") for programmatic firing. When you encounter .focusout() in older form scripts, recognize it, understand it, and migrate when practical. For delegation, validation patterns, and the complete modern focusout event workflow, continue with the jQuery focusout event tutorial.

💡 Best Practices

✅ Do

  • Use .on("focusout", handler) for all new focusout bindings
  • Use .trigger("focusout") instead of no-arg .focusout()
  • Migrate .focusout(fn) to .on("focusout", fn) when refactoring legacy files
  • Use .off("focusout") to remove handlers cleanly
  • Read the modern focusout event tutorial for focusout delegation

❌ Don’t

  • Write new form validation with deprecated .focusout(handler)
  • Assume .focusout() supports delegation — it does not
  • Confuse .focusout(fn) (bind) with .focusout() (trigger)
  • Use .unbind("focusout") — it is also deprecated; use .off("focusout")
  • Copy deprecated patterns from old tutorials without modernizing them

Key Takeaways

Knowledge Unlocked

Six things to remember about .focusout()

Legacy bind, modern migrate.

6
Core concepts
data 02

eventData

Since 1.4.3

Handler
() 03

.focusout()

Trigger

No args
.on 04

.on("focusout")

Modern

Replace
05

.trigger()

Fire

Programmatic
3.3 06

Deprecated

Since 3.3

Migrate

❓ Frequently Asked Questions

The .focusout() method has two roles. With a handler argument — .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. Both forms have been part of jQuery since 1.0; the binding form 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) or .on('focusout', eventData, handler) instead. The no-argument .focusout() trigger form still works but .trigger('focusout') is clearer and preferred in modern code.
.focusout(handler) registers a callback — it does not fire the event immediately. .focusout() with no arguments triggers the focusout event programmatically on every matched element, the same as .trigger('focusout'). The handler form is deprecated for binding; the no-arg form is a trigger shorthand.
Replace .focusout(fn) with .on('focusout', fn). Replace .focusout(data, fn) with .on('focusout', data, fn). Replace no-arg .focusout() with .trigger('focusout'). Replace .unbind('focusout') cleanup with .off('focusout'). Under the hood, .focusout(handler) delegates to .on('focusout') — migration is a straight rename.
.blur() binds or triggers the non-bubbling blur event on the matched element directly. .focusout() binds or triggers the bubbling focusout event — ideal for parent containers that validate when nested inputs lose focus. To actually move keyboard focus away, use .trigger('blur') on the current input; focusout handlers on ancestors run automatically.
Since jQuery 1.4.3, pass an object before the handler — jQuery attaches it to event.data. For example, .focusout({ rule: 'required' }, fn) on a form lets fn read event.data.rule when any nested input loses focus (bubbles). Modern equivalent: .on('focusout', { rule: 'required' }, fn).
Did you know?

jQuery unified event binding in version 1.7 with .on() and .off(), replacing shorthand methods like .focusout(), .focus(), and .bind(). The old .focusout(handler) still works but is deprecated since 3.3 — under the hood it delegates to .on("focusout"). The separate no-argument .focusout() remains valid as shorthand for .trigger("focusout"), though .trigger("focusout") is clearer in modern code.

Learn the modern focusout event API

Prefer .on("focusout") and .trigger("focusout") — full tutorial with five try-it labs.

focusout event tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful