jQuery Change Event

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

Definition

The change event fires when an input, select, or textarea value changes. Bind with .on("change", handler) (since jQuery 1.7). Selects / checkboxes / radios fire immediately; text fields fire after the value changed and the field loses focus.

Syntax

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

jQuery
$(".target").on("change", function () {
  // value committed / selection changed
});

$(".target").trigger("change");   // fire in code

// .val() does NOT fire change — trigger after script updates
$("#country").val("US").trigger("change");

// Legacy shorthand: .change() — prefer .on / .trigger
CallWhat it does
ChangeLearn the jQuery change event: bind with .on(\

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

Parameters

ParameterDescription
Step 1Select input, select, or textarea elements.
Step 2Call .on("change", handler) — optional eventData before the handler.
Step 3In the handler, read $(this).val() (or selected option text).

Return Value

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

jQuery Examples

Example 1 — Bind a Change Handler

Log when a text field or select value changes (official idea).

jQuery
$(".target").on("change", function () {
  $("#out").text(
    "change on #" + this.id + " → " + $(this).val()
  );
});
Try It Yourself

How It Works

  1. Select. $(".target") matches the text input and select.
  2. Bind. .on("change", …) registers one handler for both.
  3. Select. Picking a new option fires change immediately.

Example 2 — Trigger Change from a Button

Official pattern: another control can fire the same handlers.

jQuery
$(".target").on("change", function () {
  $("#out").text("change handler ran on #" + this.id);
});

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

How It Works

  1. Same handlers. Bound once on every .target.
  2. Natural change. User edits still fire them.
  3. Button. Click calls .trigger("change") on all matches.

Example 3 — Select Label + Init Trigger

Official demo idea: show selected option text, then fire once on load.

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

How It Works

  1. Bind. The handler reads the selected option’s text.
  2. Init. .trigger("change") runs it once for the default.
  3. Pick. Changing the select updates the label immediately.

Frequently Asked Questions

The change event fires when an input, select, or textarea value changes. Bind with .on("change", handler) (since 1.7). Selects, checkboxes, and radios fire immediately; text fields fire when the value changed and the field loses focus.
blur fires whenever focus leaves — even if the value did not change. change fires only when the committed value is different. Tab out without editing → blur yes, change no. Edit and leave → both can fire.
No. Setting a value with .val("new") does not fire change. After a script update, call .trigger("change") if handlers must run: $("#country").val("US").trigger("change").
Call $(".target").trigger("change"). Available since jQuery 1.0. Useful after AJAX fills a select or when syncing dependent dropdowns.
Yes. In modern browsers change bubbles, and jQuery normalized IE since 1.4. You can delegate: $("#form").on("change", "select", fn) for current and future selects.
change is the event name used with .on("change") / .trigger("change"). .change() is the deprecated shorthand method — prefer .on / .trigger in new code (deprecated since jQuery 3.3).

Next: .change() Method

Read the deprecated shorthand and how to migrate it.

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

10 people found this page helpful