Q:

OnChange event does not work properly

My OnChange event does not work properly - I want to trigger a function when user changes a textbox's value.  But in my tests I have seen that the function triggers when textbox's value changes and textbox loses focus.  Something wrong with my browser?  Or is it about the ability of JavaScript?  If the last one is true how can I can do that?  Thanks in advance. 

A:

onchange event will trigger when an input field loses focus or when an option is selected from a dropdown menu, that's normal behavior. 
If you want an event that will be triggered as the user types in an input field, you can use onkeypress, onkeydown or onkeyup events.