oninput Event in JavaScript
oninput Event in JavaScript
The oninput event fires when an element gets user input. It also fires when the value of an input or textarea element is changed. It is much similar to onchange 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. The oninput attribute can be used by all HTML elements.
Syntax:-
Its syntax is:- < anyElement oninput="my_script" > OR object.oninput= function(){my_script} OR object.addEventListener("input", my_script)