jQuery Blur Event

Beginner
6 min read
Updated: Oct 2026
5 examples
Live preview

What Is the blur Event?

The blur event fires when an element loses focus — Tab away, click elsewhere, or call .trigger("blur"). Bind with .on("blur", handler) (since jQuery 1.7). Originally for form fields; modern browsers also send it on other focusable elements.

Remember
$("#email").on("blur", function () {
  // user left this field
});

$("#email").trigger("blur");   // fire in code

// Opposite: focus = gains focus
// Bubbling sibling: focusout (use for delegation)
// Legacy shorthand: .blur() — prefer .on / .trigger
NeedUse
Lose focus.on("blur", handler)
Gain focus.on("focus", handler)
Delegate on a parent.on("focusout", …)
Fire in code.trigger("blur")
Legacy API.blur()

How to Use blur

Bind on the field that should react when focus leaves it.

  1. Select the element ($("#email"), $("input.name"), …).
  2. Call .on("blur", handler) — optional eventData before the handler.
  3. In the handler, read this / $(this) for the field that lost focus.
  4. To fire from a button or timer, use .trigger("blur").
  5. For one handler on a form with many (or dynamic) fields, prefer focusout.
PieceRequired?Role
ElementYesFocusable control to watch
"blur"YesEvent type string
handlerYes (to bind)Runs when focus leaves
eventDataOptionalPassed as event.data
.trigger("blur")OptionalRun handlers from code

Pseudocode

Pseudocode
element.on("blur", handler)

when element loses focus:
    // Tab away, click elsewhere, or trigger("blur")
    call handler(event)
    this = the element that lost focus

// Does NOT bubble — parent .on("blur", fn) won't see child blur
// For parent listening: use focusout instead

Cheat Sheet

Keep these facts handy while wiring form UX.

TopicDetail
Bind.on("blur" [, data], handler) (1.7+)
Trigger.trigger("blur") (1.0+)
Bubbles?No — use focusout for parents
vs focusLose focus vs gain focus
vs focusoutSame idea, but focusout bubbles
DelegationjQuery maps blur → focusout (1.4.2+)
Shorthand.blur() deprecated since 3.3
Typical useValidate or clean up when leaving a field

Live Preview

Focus the field, then leave it (Tab / click outside) or trigger blur from the button — same idea as the official jQuery API demos.

Bound with .on("blur") — Tab away or use Trigger blur.

Log
Waiting for blur…

jQuery Examples

Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.

Example 1 — Bind a Blur Handler

Log a message when the field loses focus (official idea).

jQuery
$("#target").on("blur", function () {
  $("#out").text("Handler for blur called.");
});
Try It Yourself

How It Works

  1. Select. $("#target") is the input to watch.
  2. Bind. .on("blur", …) registers the handler (1.7+).
  3. Leave. Tab away or click elsewhere — blur fires.
  4. Update. The handler writes a message to #out.

Example 2 — Trigger Blur from a Button

Official pattern: another element can fire the same handler.

jQuery
$("#target").on("blur", function () {
  $("#out").text("blur handler ran");
});

$("#other").on("click", function () {
  $("#target").trigger("blur");
});
Try It Yourself

How It Works

  1. Same handler. Bound once on #target.
  2. Natural blur. Leaving the field still runs it.
  3. Button. Click calls .trigger("blur").
  4. Reuse. One path for both user and programmatic blur.

Example 3 — Simple Validation on Blur

Check a required field when the user finishes editing it.

jQuery
$("#email").on("blur", function () {
  var value = $(this).val().trim();
  if (value === "") {
    $("#out").text("Email is required.");
  } else {
    $("#out").text("Looks good: " + value);
  }
});
Try It Yourself

How It Works

  1. Wait. Validation runs after the user leaves the field.
  2. Read. $(this).val() is the current text.
  3. Check. Empty (after trim) → show an error message.
  4. OK. Non-empty → confirm the value.

Example 4 — Pass eventData

Attach extra data when binding; read it as event.data.

jQuery
$("#name").on("blur", { field: "name" }, function (event) {
  $("#out").text(
    "Left " + event.data.field + ": " + $(this).val()
  );
});
Try It Yourself

How It Works

  1. Data. The object before the handler becomes event.data.
  2. Blur. Leaving the field runs the handler.
  3. Label. event.data.field names which control it was.
  4. Value. $(this).val() is what the user typed.

Example 5 — blur vs focusout

Direct blur on the input; bubbling focusout on the form.

jQuery
$("#email").on("blur", function () {
  $("#out").append("blur on #email\n");
});

$("form").on("focusout", function (event) {
  $("#out").append(
    "focusout on form (from " + event.target.id + ")\n"
  );
});
Try It Yourself

How It Works

  1. blur. Bound on the field — fires for that field only.
  2. focusout. Bound on the form — sees nested fields leave focus.
  3. Both can run. Leaving #email may log both lines.
  4. Choose. Single field → blur; whole form → focusout.

Edge Cases & Pitfalls

Watch for these when using blur in real forms.

bubble

Does not bubble

A parent .on("blur", …) will not see child blur. Use focusout for form-level handlers.

legacy

.blur() is deprecated

Since jQuery 3.3, prefer .on("blur") and .trigger("blur") over the shorthand method.

alert

Alerts can steal focus

Showing alert() inside a blur handler can cause awkward focus loops. Prefer updating a message in the page.

ie

IE async blur (historical)

Native blur was async in IE. As of jQuery 3.7.0, jQuery uses focusout as the backing event for blur in IE to avoid timing bugs.

Browser Support

The blur event is a standard browser event. jQuery’s .on("blur") API has been available since 1.7; .trigger("blur") since 1.0. Works wherever your loaded jQuery version runs.

✓ Stable · DOM focus

blur event

Supported in all modern browsers. Prefer jQuery 3.x so .on("blur") / .trigger("blur") and IE focusout mapping (3.7+) are available.

100% Event support
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
blur Universal

Bottom line: Safe for production forms. Use .on("blur") for single fields; use focusout when one parent handler should cover many inputs.

Performance Notes

ApproachCostBest for
$el.on("blur", fn)CheapOne field, direct bind
$form.on("focusout", fn)CheapMany / dynamic fields
Heavy work in handlerCan stutterKeep blur handlers light (validate, message)
Binding every input separatelyMore listenersPrefer one focusout on the form when possible

Blur handlers run only when focus moves. Keep them short — validate and update UI — and avoid network calls on every blur unless you debounce.

Key Takeaways

  • Role: react when an element loses focus.
  • Modern API: .on("blur") / .trigger("blur") — not .blur().
  • No bubble: use focusout for parent/form handlers.
  • Pair with focus: show hints on focus, validate on blur.

One line: blur means “this field just lost focus” — bind with .on("blur") for per-field UX.

Frequently Asked Questions

The blur event fires when an element loses focus — the user tabs away, clicks elsewhere, or you call .trigger("blur"). Bind handlers with .on("blur", handler) (since 1.7). It applies to form controls and other focusable elements.
They are opposites. focus fires when an element gains focus; blur fires when it loses focus. Pair them for UX: show a hint on focus, validate or hide it on blur.
No. Native blur does not bubble. For one handler on a parent form (including dynamic fields), use focusout — it bubbles. Since 1.4.2, jQuery maps blur to focusout in its delegation methods.
Call $('#target').trigger("blur"). That runs bound blur handlers and moves focus away per browser rules. Useful when a button should force a field’s blur validation before submit.
Both. Blur gives feedback right after the user leaves a field. Submit catches anything missed. Common pattern: light checks on blur, full form check on submit.
blur is the event name used with .on("blur") / .trigger("blur"). .blur() is the deprecated shorthand method — prefer .on("blur") and .trigger("blur") in new code (deprecated since jQuery 3.3).

Next: Focusout Event

Use a bubbling lose-focus event on parent forms.

focusout 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.

10 people found this page helpful