I'm trying to write something which will detect input in a form field, but I want it to be triggered not just on a keypress but if the user were also to hold a key down for multiple repeat characters, or if they were also to copy & paste something into the input field.
I've tried using keyup
event but this does not meet all my requirements, and change
event doesn't seem to be a good fit either. Please can anyone advise an event which may be more suitable?
Thank you.
You might be looking for jQuery's input
event.
$('inputSelector').on('input', function() {});
Look at the following JSFiddle for an example: http://jsfiddle.net/philfreo/MqM76/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With