html event attribute onchange triggered when element value changes

黄舟
Release: 2018-05-15 10:13:12
Original
5926 people have browsed it

Example

Check the input field when the value changes:

<input type="text" name="txt" value="Hello" onchange="checkField(this.value)">
Copy after login
Copy after login

Browser support

IE

Firefox

Chrome

Safari

Opera

All major browsers support onchange attribute.

Definition and usage

onchange is triggered when the element value changes.

The onchange attribute applies to: ,