When using jquery .change
on an input
the event will only be fired when the input loses focus
In my case, I need to make a call to the serv
As others already suggested, the solution in your case is to sniff multiple events.
Plugins doing this job often listen for the following events:
$input.on('change keydown keypress keyup mousedown click mouseup', handler);
If you think it may fit, you can add focus
, blur
and other events too.
I suggest not to exceed in the events to listen, as it loads in the browser memory further procedures to execute according to the user's behaviour.
Attention: note that changing the value of an input element with JavaScript (e.g. through the jQuery .val()
method) won't fire any of the events above.
(Reference: https://api.jquery.com/change/).