jQuery Change Event

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Form events

What You’ll Learn

The change event fires when an element’s value changes. This tutorial covers binding with .on("change"), passing eventData, triggering with .trigger("change"), handling selects vs text inputs, comparing change with blur and input, and why .val() does not fire change automatically.

01

.on()

Bind handler

02

eventData

Pass data

03

.trigger()

Fire change

04

Select

Immediate

05

Text input

On blur

06

Since 1.7

Modern API

Introduction

Dropdown menus, checkboxes, and text fields all need code that reacts when the user picks a different value. The change event is the standard signal that a form control’s value actually changed — not merely that the user clicked into or out of the field.

The official jQuery API distinguishes the change event (bound with .on("change") since 1.7) from the deprecated .change() method used in older code. To programmatically run change handlers after updating a value with script, use .trigger("change") — available since jQuery 1.0.

Understanding the change Event

The change event is sent to an element when its value changes. It applies to <input> (text, checkbox, radio, etc.), <select>, and <textarea> elements. The timing depends on the control type:

  • Select, checkbox, radio — change fires immediately when the user makes a new selection with the mouse or keyboard.
  • Text inputs and textareas — change is deferred until the element loses focus, and only if the value actually changed. Tab away without editing → no change event.
💡
Beginner Tip

Setting a value with .val("new") does not fire change. After programmatic updates — AJAX-loaded dropdown options, prefilled forms, or syncing fields — call .trigger("change") so your handlers run.

📝 Syntax

The modern jQuery API for the change event has two main forms — binding a handler and triggering the event:

1. Bind a handler — .on("change" [, eventData ], handler) (since 1.7)

jQuery
.on( "change" [, eventData ], handler )
  • eventData — optional object passed to the handler as event.data.
  • handler — function called each time change fires: function( event ) { ... }.

2. Event delegation — .on("change", selector, handler)

jQuery
$( "#form" ).on( "change", "select", function( event ) {
  // runs when any select inside #form changes — including future ones
} );

The change event bubbles (jQuery normalized IE bubbling since 1.4), so delegation works on parent forms.

3. Trigger the event — .trigger("change") (since 1.0)

jQuery
.trigger( "change" )
  • Runs bound change handlers on the matched element(s).
  • Required after .val() updates when handlers must react to script-driven changes.

4. Unbind — .off("change" [, selector] [, handler])

jQuery
$( ".target" ).off( "change" );              // remove all change handlers
$( "#form" ).off( "change", "select", fn );  // remove delegated handler

Official jQuery API examples

jQuery
$( ".target" ).on( "change", function() {
  alert( "Handler for `change` called." );
} );

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

Return value

  • .on() and .trigger() return the original jQuery object for chaining.
  • Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).

⚡ Quick Reference

GoalCode
Bind change handler$("#country").on("change", fn)
Pass data to handler$("select").on("change", { id: 1 }, fn)
Delegated change on selects$("#form").on("change", "select", fn)
Trigger change programmatically$("#country").trigger("change")
After .val() update$("#country").val("US").trigger("change")
Remove change handlers$("#country").off("change")
Initial draw on page load$("select").on("change", fn).trigger("change")

📋 change vs blur vs input vs deprecated .change()

Four related form events — pick the one that matches when the value changes and how quickly you need to react.

change
value diff

Fires when committed value changes — immediate on select/checkbox, on blur for text inputs

blur
lose focus

Fires when focus leaves — even if value unchanged; good for validation UI on exit

input
each keystroke

Fires live as user types — search boxes and character counters

.change() method
deprecated

Old binding shorthand — use .on("change") and .trigger("change") instead

Examples Gallery

Examples 1–2 follow the official jQuery API documentation. Examples 3–5 expand on the official select demo, text validation, and delegation. Use the Try-it links to run each snippet in the browser.

📚 Binding & Triggering

Official jQuery demos for change handlers on text inputs and select boxes.

Example 1 — Official Demo: Bind Handler on .target

Alert when a text input or select box value changes — the canonical .on("change") pattern.

jQuery
$( ".target" ).on( "change", function() {
  alert( "Handler for `change` called." );
} );
Try It Yourself

How It Works

.on("change", fn) on .target covers both the text input and the select. Selects fire change instantly; text inputs wait until blur and only if the value differs from when focus entered.

Example 2 — Official Demo: #other Triggers Change on .target

One button programmatically fires change handlers on all matched form controls.

jQuery
$( ".target" ).on( "change", function() {
  alert( "Handler for `change` called." );
} );

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

How It Works

.trigger("change") on a jQuery collection fires the event on each matched element. With two .target controls, the handler runs twice — once per element. Use this after .val() updates or to sync UI on load.

📈 Official Extended Demos

Select summaries, text validation, and delegation from the jQuery API documentation.

Example 3 — Official Demo: Show Selected Option Text

Build a summary string from selected options and trigger change on page load for the initial draw.

jQuery
$( "select" ).on( "change", function() {
  var str = "";
  $( "select option:selected" ).each( function() {
    str += $( this ).text() + " ";
  } );
  $( "#summary" ).text( str );
} ).trigger( "change" );
Try It Yourself

How It Works

The handler reads option:selected text and writes it to #summary. Calling .trigger("change") immediately after binding runs the handler once with the default selection — no blank summary on first paint.

Example 4 — Official Demo: Validity Check on Text Inputs

Add a change handler to all text inputs — run validation only when the committed value changes.

jQuery
$( "input[type='text']" ).on( "change", function() {
  var value = $( this ).val();
  var valid = value.length >= 3;
  $( this ).toggleClass( "invalid", !valid );
  console.log( "Changed:", value, "| valid:", valid );
} );
Try It Yourself

How It Works

Unlike input, change on text fields waits until the user commits by leaving the field. Validation runs once per actual value change — not on every keystroke.

Example 5 — Delegated Change on Dynamic Select Elements

Bind once on the form — change handlers cover selects added later via JavaScript.

jQuery
$( "#order-form" ).on( "change", "select", function() {
  var label = $( this ).find( "option:selected" ).text();
  $( "#log" ).text( "Selected: " + label );
} );
Try It Yourself

How It Works

Because change bubbles, jQuery listens on #order-form and runs the handler when a select inside it changes. New selects appended with .append() need no extra binding.

🚀 Common Use Cases

  • Country → state dropdowns$("#country").on("change", loadStates) reloads dependent options.
  • Price calculators — update totals when the user changes quantity or plan in a select.
  • Toggle sections — show/hide form sections when a radio or checkbox changes.
  • Filter tables — refresh results when a filter select changes — fires immediately, no blur needed.
  • Post-.val() sync$("#tier").val("pro").trigger("change") after AJAX prefills a form.
  • Initial UI draw.on("change", fn).trigger("change") on load to reflect default selections.

🧠 How the change Event Flows

1

User interacts

Picks a new dropdown option, toggles a checkbox, or edits text and tabs away.

input
2

Value comparison

Browser checks whether the value actually changed. No change → no event (even on blur).

compare
3

change event fires

Immediate for select/checkbox/radio; deferred until blur for text inputs. Event bubbles up the DOM.

change
4

Handler runs

Your function executes — update summaries, load data, or validate. $(this) is the control that changed.

📝 Notes

  • Bind with .on("change", handler) since jQuery 1.7 — not the deprecated .change(handler) method.
  • Trigger with .trigger("change") since jQuery 1.0.
  • Limited to <input>, <select>, and <textarea> — not generic divs.
  • Text inputs: change fires on blur only if the value changed since focus.
  • Select/checkbox/radio: change fires immediately on new selection.
  • .val(newValue) does not fire change — call .trigger("change") afterward.
  • Change bubbles — jQuery fixed IE bubbling consistency since 1.4.
  • Use .off("change") to remove handlers — avoid deprecated .unbind("change").

Browser Support

The change event is a standard DOM form event supported in every browser jQuery targets. jQuery’s .on("change") (since 1.7) and .trigger("change") (since 1.0) normalize cross-browser behavior — including IE bubbling fixed in jQuery 1.4.

jQuery 1.7+

jQuery change event

Supported in jQuery 1.x, 2.x, and 3.x across all modern browsers and IE with supported jQuery versions. Native equivalent: element.addEventListener('change', fn) — jQuery adds collection binding, eventData, delegation, and .trigger() in one chainable API.

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 Universal

Bottom line: Safe in any jQuery project. Prefer .on('change') over deprecated .change() for binding. Remember to .trigger('change') after programmatic .val() updates.

Conclusion

The jQuery change event is the standard way to respond when a form control’s value actually changes. Bind handlers with .on("change", fn), pass optional eventData, and fire handlers programmatically with .trigger("change") — especially after .val() updates.

Remember the timing split: selects and checkboxes fire immediately; text inputs wait until blur and only when the value differs. Use input for live typing feedback and blur for focus-exit validation. For dynamic forms, delegate with $("#form").on("change", "select", fn).

💡 Best Practices

✅ Do

  • Bind with .on("change", handler) — the modern, delegation-capable API
  • Call .trigger("change") after .val() when handlers must run
  • Use .on("change", fn).trigger("change") to initialize UI from default values
  • Delegate on parent forms for AJAX-loaded selects and dynamic fields
  • Use change for dropdowns; pair with input if you need live text feedback

❌ Don’t

  • Use deprecated .change(handler) for new code — use .on("change")
  • Expect change on every keystroke in text fields — use input instead
  • Assume .val("x") runs change handlers — trigger manually
  • Confuse change with blur — blur fires even when value is unchanged
  • Forget that tabbing away without editing does not fire change on text inputs

Key Takeaways

Knowledge Unlocked

Six things to remember about the change event

Bind, trigger, react to new values.

6
Core concepts
02

.trigger()

Fire

Programmatic
select 03

Immediate

Select/radio

Timing
text 04

On blur

Text input

Deferred
.val 05

No auto-fire

Trigger manually

Pitfall
06

Bubbles

Delegate

Pattern

❓ Frequently Asked Questions

The change event fires when an element's value changes. In modern jQuery, bind handlers with .on('change', handler) since version 1.7. It applies to input, select, and textarea elements. For dropdowns, checkboxes, and radio buttons, change fires immediately when the user picks a new option. For text inputs, it fires when the user edits the value and then leaves the field — but only if the value actually changed.
blur fires whenever an element loses focus — even if the value did not change. change fires only when the committed value is different from before. Tab out of a text field without editing → blur yes, change no. Edit text and tab away → both fire. Use blur for 'user finished with this field'; use change for 'the form value actually changed'.
The input event fires on every keystroke as the user types in a text field. change fires later — for text inputs, only after the value changes and the field loses focus. Use input for live character counts or search-as-you-type; use change when you only care about the final committed value, such as updating a summary when the user picks from a dropdown.
No. Setting a value programmatically with .val('new value') does not fire the native change event. If you need handlers to run after a script updates a field, call .trigger('change') manually: $('#country').val('US').trigger('change').
Call $('.target').trigger('change') on the element. Available since jQuery 1.0, trigger runs bound change handlers. Useful after AJAX loads options into a select, or when syncing dependent dropdowns after .val() updates.
Yes. The change event bubbles in modern browsers, and jQuery normalized bubbling in Internet Explorer since version 1.4. You can use event delegation: $('#form').on('change', 'select', fn) handles current and future select elements inside the form.
Did you know?

Changing an input’s value with JavaScript — including jQuery’s .val() — does not fire the native change event. That is by design: scripts can update fields silently without triggering user-facing side effects. When your handler should run after a script sets a value, chain .trigger("change"): $("#plan").val("enterprise").trigger("change").

Next: .change() Method

Learn the deprecated shorthand — and how to migrate to .on("change").

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

6 people found this page helpful