HTML onchange Attribute
HTML onchange Attribute
The onchange attribute fires the moment when the value of the element is changed. It is much similar to oninput event but the difference is that oninput event occurs when the element value changes while in the case of onchange attribute the event occurs when the element loses focus. Moreover, onchange works with select elements.
Used With:-
Elements | Event |
---|---|
All elements in HTML | onchange |
Syntax:-
Its syntax is:- < element onchange="your_script" >