onchange
is only triggered when the control is out of focus. That means you have to click outside of the input field after typing something to fire the onchange
event.
If you need event to fire immediately after every keystroke, use onkeyup
, onkeydown
or onkeypress
instead.