jQuery .change() Method

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

What Is .change()?

.change() is jQuery’s legacy shorthand for binding or triggering the form change event on input, select, and textarea elements. Binding is deprecated since 3.3; modern code uses .on("change") / .trigger("change").

Remember
// Legacy (still works; bind form deprecated since 3.3)
$("#country").change(function () {
  // value changed
});

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

// .val() does NOT fire change — trigger after script updates
$("#country").val("US").trigger("change");
NeedUse
New code (bind).on("change", fn)
New code (trigger).trigger("change")
Legacy bind.change(fn) ⚠ deprecated 3.3
Legacy trigger.change() (prefer .trigger)
Delegation.on("change", "select", fn) — not via .change()

How to Use .change()

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

  1. Bind with .change(handler) (legacy) or .on("change", handler) (preferred).
  2. Optionally pass eventData: .change(data, handler) → .on("change", data, handler).
  3. Trigger with no-arg .change() (legacy) or .trigger("change") (preferred).
  4. After .val(), always trigger manually — script updates do not fire change.
  5. For dynamic fields, use delegated .on("change", selector, fn) — not .change().
PieceRequired?Role
handlerFor bind formfunction(event) — runs when the value changes
eventDataOptional (1.4.3+)Extra data available as event.data
No-arg callFor triggerFires change on each matched element
Target elementsYesinput, select, textarea

Pseudocode

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

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

// Modern (jQuery 1.7+)
call element.on("change", handler)
when user changes value (select: immediate; text: on blur):
    fire "change" on element
    call handler(event)

when script sets value with .val():
    change does NOT fire
    call element.trigger("change") if handlers must run

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

Cheat Sheet

Quick map from the shorthand to modern APIs.

TopicDetail
Legacy bind$("select").change(handler) ⚠ deprecated 3.3
Modern bind$("select").on("change", handler)
Legacy trigger$("select").change()
Modern trigger$("select").trigger("change")
After .val()$("#tier").val("pro").trigger("change")
Init on load.on("change", fn).trigger("change")
Unbind$("select").off("change" [, handler])
Since / status1.0 · eventData 1.4.3 · bind deprecated 3.3
TimingSelect/checkbox: immediate · text: on blur if value changed

Live Preview

Pick an action against a sample select. The demo uses .change() (still available in jQuery 3.x) so you can see bind vs trigger.

Demo select: Free / Pro / Enterprise — compare silent .val() vs trigger.

Result
Ready — pick an action and click Run.

jQuery Examples

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

Example 1 — Basic .change(handler)

Update a label when the user picks a new dropdown option.

jQuery
$("#country").change(function () {
  var label = $("#country option:selected").text();
  $("#out").text("Selected: " + label);
});
Try It Yourself

How It Works

  1. Bind. .change(fn) registers the handler on #country.
  2. Pick. Changing the select fires change right away.
  3. Read. option:selected gives the visible label.
  4. Show. The status text updates — prefer .on("change", fn) in new code.

Example 2 — .change(eventData, handler)

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

jQuery
$(".plan-select").change({ currency: "USD" }, function (event) {
  var plan = $(this).val();
  $("#out").text("Plan: " + plan + " | currency: " + event.data.currency);
});
Try It Yourself

How It Works

  1. Data. The object becomes event.data inside the handler.
  2. Change. Any matched select fires the shared callback.
  3. Read. Use $(this).val() for the new value.
  4. Migrate. Replace with .on("change", { currency: "USD" }, fn).

Example 3 — Trigger After .val()

Setting a value with script is silent — chain no-arg .change() to run handlers.

jQuery
$("#tier").change(function () {
  $("#out").text("Tier is now: " + $(this).val());
});

$("#set-pro").on("click", function () {
  $("#tier").val("pro").change(); // prefer .trigger("change")
});
Try It Yourself

How It Works

  1. Bind. The handler is registered first.
  2. Silent set. .val("pro") updates the control without firing change.
  3. Trigger. No-arg .change() runs bound handlers.
  4. Prefer. Use .trigger("change") in new code.

Example 4 — Migrate to .on("change")

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

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

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

How It Works

  1. Legacy. .change(fn) internally calls .on("change", fn).
  2. Modern. Bind directly with .on().
  3. Same event. Select timing and values are unchanged.
  4. Bonus. Only .on() supports delegation on dynamic forms.

Example 5 — Init Chain .change(fn).change()

Bind a handler and fire it once on load so the UI matches the default option.

jQuery
$("#flavor")
  .change(function () {
    var text = $("#flavor option:selected").text();
    $("#summary").text("You picked: " + text);
  })
  .change();
Try It Yourself

How It Works

  1. Bind. The first .change(fn) stores the handler.
  2. Trigger. The second .change() fires it immediately.
  3. Default. The summary shows the selected option on load.
  4. Migrate. Prefer .on("change", fn).trigger("change").

Edge Cases & Pitfalls

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

deprecated

Bind form deprecated since 3.3

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

.val()

.val() does not fire change

Script updates stay silent. Chain .trigger("change") (or legacy .change()) when handlers must run.

timing

Text inputs wait for blur

Selects and checkboxes fire immediately; text fields fire on blur only if the value changed.

delegation

No built-in delegation

.change(fn) cannot target future elements. Use $("#form").on("change", "select", fn).

Browser Support

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

✓ Deprecated · jQuery 3.3

jQuery .change()

Works in jQuery 1.x–3.x. Prefer .on('change') / .trigger('change') for new projects. Native equivalent: addEventListener('change', 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
.change() Legacy API

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

Performance Notes

ApproachCostBest for
Direct .on("change") on known fieldsCheapStatic forms and dropdowns
Delegated .on("change", selector, fn)CheapDynamic rows / AJAX-injected fields
Heavy work inside every changeExpensiveAvoid — keep handlers light

The shorthand and .on("change") cost the same for a single bind. Prefer .on() for clarity and delegation. Keep the callback light — update a label or toggle a class, then stop.

Key Takeaways

  • Role: legacy bind/trigger for form value changes.
  • Migrate: .on("change", fn) and .trigger("change").
  • .val() trap: script updates need an explicit trigger.
  • Delegation: only available via .on("change", selector, fn).

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

Frequently Asked Questions

The .change() method has two roles. With a handler — .change(handler) or .change(eventData, handler) — it binds a function that runs when an input, select, or textarea value changes. With no arguments — .change() — it triggers the change event on each matched element. Binding has been part of jQuery since 1.0 and is deprecated since 3.3.
Yes. The binding signatures .change(handler) and .change(eventData, handler) are deprecated since jQuery 3.3. Use .on("change", handler) instead. The no-argument .change() trigger still works, but .trigger("change") is clearer. Legacy code continues to run in jQuery 3.x.
.change(handler) registers a callback and does not fire immediately. .change() with no arguments triggers the change event — the same as .trigger("change"). Check whether parentheses contain a function before reading legacy code.
Replace .change(fn) with .on("change", fn). Replace .change(data, fn) with .on("change", data, fn). Replace no-arg .change() with .trigger("change"). Cleanup with .off("change"). Under the hood, .change(handler) already delegates to .on("change").
No. Setting a value with .val("new") does not fire change — whether you bound with .change(fn) or .on("change", fn). After programmatic updates, call .change() or .trigger("change"): $("#country").val("US").trigger("change").
No. Direct .change(fn) only binds to elements that already match. For dynamic fields, use .on("change", "select", fn) on a parent. That is one reason to prefer .on() over the shorthand.

Next: select event

Learn how to react when the user highlights text inside an input or textarea.

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

9 people found this page helpful