ExampleCheck an input field when the value is changed: |
Browser Support |
1. Definition and Usage
The onchange attribute fires the moment when the value of the element is changed.
The onchange attribute can be used with the <input>, <textarea>, and <select> elements.
2. Differences Between HTML 4.01 and HTML5
None.
3. Syntax
1 |
< element onchange = "script" > |
4. Attribute Values
Value | Description |
---|---|
script | The script to be run on onchange |