YouTip LogoYouTip

Event Change

# jQuery change() Method [![Image 3: jQuery Event Methods](#) jQuery Event Methods](#) ## Example Alert text when the field changes: $("input").change(function(){ alert("Text has been changed"); }); [Try it Β»](#) * * * ## Definition and Usage The change event occurs when the value of an element is changed (only for form fields). The change() method triggers the change event, or specifies a function to run when the change event occurs. **Note:** When used with select elements, the change event occurs when an option is selected. When used with text fields or text areas, the change event occurs when the element loses focus. * * * ## Syntax Trigger the change event for the selected elements: $(_selector_).change() (#) Add a function to the change event: $(_selector_).change(_function_) (#) | Parameter | Description | | :--- | :--- | | _function_ | Optional. Specifies the function to run when the change event occurs for the selected elements. | * * jQuery Event Methods](#)
← Event ClickEvent Blur β†’