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
Fundamentals
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 changeevent (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.
Concept
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.
Foundation
📝 Syntax
The modern jQuery API for the change event has two main forms — binding a handler and triggering the event:
.on() and .trigger() return the original jQuery object for chaining.
Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).
Cheat Sheet
⚡ Quick Reference
Goal
Code
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")
Compare
📋 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
Hands-On
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.
Select "Option 2" from dropdown → alert immediately
Edit text field, then tab away → alert (value changed)
Tab away from text field without editing → no alert
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.
Click #other → $(".target").trigger("change")
Handler runs once per .target element (text input + select)
Alert may appear twice — one binding, two elements
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.
Page load → .trigger("change") → #summary shows default selection
User picks "Caramel" → #summary updates to "Caramel"
Chaining .trigger("change") after .on() is a common init pattern
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 );
} );
Type "ab" and tab away → .invalid added, valid: false
Type "abc" and tab away → .invalid removed, valid: true
Typing alone does not fire change — must blur after edit
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.
Change existing select → #log updates
Click "Add flavor" → new select appears → change still works
One handler on #order-form covers all select children
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.
Applications
🚀 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.
Important
📝 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").
Compatibility
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 ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
changeUniversal
Bottom line: Safe in any jQuery project. Prefer .on('change') over deprecated .change() for binding. Remember to .trigger('change') after programmatic .val() updates.
Wrap Up
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).
Confuse change with blur — blur fires even when value is unchanged
Forget that tabbing away without editing does not fire change on text inputs
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about the change event
Bind, trigger, react to new values.
6
Core concepts
.on01
.on("change")
Bind
API
⚡02
.trigger()
Fire
Programmatic
select03
Immediate
Select/radio
Timing
text04
On blur
Text input
Deferred
.val05
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").