jQuery .blur() Method

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

What Is .blur()?

.blur() is jQuery’s legacy shorthand for binding or triggering the blur event — when an element loses focus. Binding is deprecated since 3.3; modern code uses .on("blur") / .trigger("blur").

Remember
// Legacy (still works; bind form deprecated since 3.3)
$("#email").blur(function () {
  // field lost focus
});

// Modern replacements
$("#email").on("blur", handler);   // bind
$("#email").trigger("blur");       // fire

// No-arg .blur() = trigger (prefer .trigger("blur"))
$("#email").blur();
NeedUse
New code (bind).on("blur", fn)
New code (trigger).trigger("blur")
Legacy bind.blur(fn) ⚠ deprecated 3.3
Legacy trigger.blur() (prefer .trigger)
Parent / dynamic fields.on("focusout", …) — not .blur()

How to Use .blur()

Recognize the legacy API in old code, then migrate to .on() / .trigger().

  1. Bind with .blur(handler) (legacy) or .on("blur", handler) (preferred).
  2. Optionally pass eventData: .blur(data, handler) → .on("blur", data, handler).
  3. Trigger with no-arg .blur() (legacy) or .trigger("blur") (preferred).
  4. In the handler, use this / $(this) for the field that lost focus.
  5. For form-level or dynamic fields, use focusout — .blur() does not bubble or delegate.
PieceRequired?Role
handlerFor bind formfunction(event) — runs when focus leaves
eventDataOptional (1.4.3+)Extra data available as event.data
No-arg callFor triggerFires blur on each matched element
Target elementsYesFocusable controls (inputs, etc.)

Pseudocode

Pseudocode
// Legacy
call element.blur(handler)
    → bind "blur" on element

call element.blur()
    → trigger "blur" on element

// Modern (jQuery 1.7+)
call element.on("blur", handler)
when element loses focus (Tab, click elsewhere, or trigger):
    fire "blur" on element
    call handler(event)

// Does NOT bubble — parent .blur(fn) won't see child blur

to migrate:
    .blur(fn)       → .on("blur", fn)
    .blur(data, fn) → .on("blur", data, fn)
    .blur()         → .trigger("blur")

Cheat Sheet

Quick map from the shorthand to modern APIs.

TopicDetail
Legacy bind$("#email").blur(handler) ⚠ deprecated 3.3
Modern bind$("#email").on("blur", handler)
Legacy trigger$("#email").blur()
Modern trigger$("#email").trigger("blur")
eventData.blur({ field: "email" }, fn) → event.data
Unbind$("#email").off("blur" [, handler])
Since / status1.0 · eventData 1.4.3 · bind deprecated 3.3
Bubbles?No — use focusout for parents
Official docsapi.jquery.com/blur-shorthand

Live Preview

Focus the field, then leave it — or fire blur from the button. The demo uses legacy .blur() so you can see bind vs trigger.

Bound with .blur(fn) — Tab away or click .blur(). Prefer .on("blur") in new code.

Log
Waiting for blur…

jQuery Examples

Short, copy-ready snippets. Prefer .on("blur") for new projects; these demos show the legacy API you will still meet in older code.

Example 1 — Basic .blur(handler)

Log a message when the field loses focus.

jQuery
$("#target").blur(function () {
  $("#out").text("Handler ran via .blur(fn).");
});
Try It Yourself

How It Works

  1. Bind. .blur(fn) registers the handler on #target.
  2. Leave. Tab away or click elsewhere — blur fires.
  3. Update. The handler writes a message to #out.
  4. Prefer. Use .on("blur", fn) in new code.

Example 2 — Trigger with No-Arg .blur()

A button fires the same handler without the user leaving the field first.

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

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

How It Works

  1. Bind. The handler is registered with .blur(fn).
  2. Natural blur. Leaving the field still runs it.
  3. Button. No-arg .blur() triggers the same event.
  4. Prefer. Use .trigger("blur") in new code.

Example 3 — .blur(eventData, handler)

Pass metadata (since 1.4.3). Modern form: .on("blur", data, fn).

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

How It Works

  1. Data. The object becomes event.data inside the handler.
  2. Blur. Leaving the field runs the callback.
  3. Read. Use event.data.field and $(this).val().
  4. Migrate. Replace with .on("blur", { field: "name" }, fn).

Example 4 — Validate on Blur (Legacy)

Check a required field when the user finishes editing it.

jQuery
$("#email").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.
  4. Migrate. Prefer .on("blur", fn) for the same logic.

Example 5 — Migrate to .on("blur")

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

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

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

How It Works

  1. Legacy. .blur(fn) internally calls .on("blur", fn).
  2. Modern. Bind directly with .on().
  3. Same event. Focus-loss timing is unchanged.
  4. Bonus. Only .on() supports delegation (via focusout mapping).

Edge Cases & Pitfalls

Watch for these when reading or migrating legacy .blur() code.

deprecated

Bind form deprecated since 3.3

Still works in jQuery 3.x, but new code should use .on("blur").

bubble

Does not bubble

A parent .blur(fn) will not see child blur. Use focusout for form-level handlers.

alert

Alerts can steal focus

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

delegation

No built-in delegation

.blur(fn) cannot target future elements. Use $("#form").on("focusout", "input", fn).

Browser Support

The underlying blur event is a standard DOM focus event. The .blur() method is a jQuery API available since 1.0 (eventData since 1.4.3). Binding via .blur(handler) is deprecated since 3.3 but still functional in jQuery 3.x.

✓ Deprecated · jQuery 3.3

jQuery .blur()

Works in jQuery 1.x–3.x. Prefer .on('blur') / .trigger('blur') for new projects. Native equivalent: addEventListener('blur', fn).

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
.blur() Legacy API

Bottom line: Safe in legacy projects. Migrate bindings to .on('blur') and triggers to .trigger('blur') when you touch form scripts.

Performance Notes

ApproachCostBest for
Direct .on("blur") on known fieldsCheapStatic form fields
Delegated .on("focusout", selector, fn)CheapDynamic / many fields
Heavy work inside every blurCan stutterKeep handlers light; debounce network calls

The shorthand and .on("blur") cost the same for a single bind. Prefer .on() for clarity and delegation. Keep the callback light — validate and update UI, then stop.

Key Takeaways

  • Role: legacy bind/trigger when an element loses focus.
  • Migrate: .on("blur", fn) and .trigger("blur").
  • Two forms: .blur(fn) binds; no-arg .blur() triggers.
  • No bubble: use focusout for parent handlers.

One line: .blur() is deprecated sugar for .on("blur") / .trigger("blur") — migrate when you touch the file.

Frequently Asked Questions

The .blur() method has two roles. With a handler — .blur(handler) or .blur(eventData, handler) — it binds a function that runs when the element loses focus. With no arguments — .blur() — it triggers the blur event on each matched element. Binding has been part of jQuery since 1.0 and is deprecated since 3.3.
Yes. The binding signatures .blur(handler) and .blur(eventData, handler) are deprecated since jQuery 3.3. Use .on("blur", handler) instead. The no-argument .blur() trigger still works, but .trigger("blur") is clearer. Legacy code continues to run in jQuery 3.x.
.blur(handler) registers a callback and does not fire immediately. .blur() with no arguments triggers the blur event — the same as .trigger("blur"). Check whether parentheses contain a function before reading legacy code.
Replace .blur(fn) with .on("blur", fn). Replace .blur(data, fn) with .on("blur", data, fn). Replace no-arg .blur() with .trigger("blur"). Cleanup with .off("blur"). Under the hood, .blur(handler) already delegates to .on("blur").
No. Native blur does not bubble. A parent .blur(fn) will not see child fields lose focus. Use focusout (or .on("focusout")) on the form for parent-level handlers. Since 1.4.2, jQuery maps blur to focusout in its delegation methods.
No. Direct .blur(fn) only binds to elements that already match. For dynamic fields, use .on("focusout", "input", fn) on a parent — another reason to prefer .on() over the shorthand.

Next: Change Event

React when a control’s value is committed.

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

9 people found this page helpful