jQuery form event change() event
change event (change event)
Definition and usage
The change event occurs when the value of an element changes.
This event only applies to text fields, textarea and select elements.
change() function triggers a change event, or specifies a function to run when a change event occurs.
Note: When used with select elements, the change event occurs when an option is selected. When used with a text field or text area, this event occurs when the element loses focus.
Let’s write an example below
php 中文网
When the value in the drop-down option box changes, the color of the text in the p tag will change