Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery alternative to keyup

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.

like image 705
Charlie Allen Avatar asked Feb 23 '16 14:02

Charlie Allen


1 Answers

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/

like image 85
Kishor Avatar answered Oct 05 '22 00:10

Kishor