Reputation:
I have this HTML:
<input type="text" onChange="function()">
It calls a function everytime the input value change, but to call the function you have to press the enter button or click on something that isn't the input and this is quite annoying. Is there a way to call the function everytime the text in the input change? without having to press any button or click out of the input.
Upvotes: 1
Views: 3978
Reputation: 109
You can also use keyboard events to catch input
field changes
<input type="text" onkeyup="myFunc()">
Different keyboard events are
onkeyup
onkeydown
onkeypress
Upvotes: 1