jQuery .change() Method

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

Definition

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

Syntax

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

jQuery
// 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");
CallWhat it does
handlerfunction(event) — runs when the value changes
eventDataExtra data available as event.data
No-arg callFires change on each matched element
Target elementsinput, select, textarea

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

Parameters

ParameterDescription
Step 1Bind with .change(handler) (legacy) or .on("change", handler) (preferred).
Step 2Optionally pass eventData: .change(data, handler) → .on("change", data, handler).
Step 3Trigger with no-arg .change() (legacy) or .trigger("change") (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 .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.

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.

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.

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 →

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