jQuery .blur() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Form Events

Definition

.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").

Syntax

Start with these common calls. Keep them short and readable.

jQuery
// 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();
CallWhat it does
handlerfunction(event) — runs when focus leaves
eventDataExtra data available as event.data
No-arg callFires blur on each matched element
Target elementsFocusable controls (inputs, etc.)

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Bind with .blur(handler) (legacy) or .on("blur", handler) (preferred).
Step 2Optionally pass eventData: .blur(data, handler) → .on("blur", data, handler).
Step 3Trigger with no-arg .blur() (legacy) or .trigger("blur") (preferred).

Return Value

Return ValueDescription
jQuery objectMost setters and traversing helpers return the jQuery collection so you can chain more methods.

jQuery Examples

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.

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.

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().

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 Event tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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