Keyup, Change, Blur - multiple jQuery events for same function

I need to call the function when user is typing into input field, but also when he changed the value without typing it, for example with copy and paste. How should I modify the code, to use the same function in case of multiple events: onKeyUp, onChange, onBlur ?

$("input").keyup(function(){

});
0
give a positive ratinggive a negative rating
02 Oct 2020 at 06:42 PM
Hi,

To use Keyup, Change and Blur events together for the same jQuery function, you can use the solution with .on() and added events:


$("input").on("keyup change blur", function(){

});

0
give a positive ratinggive a negative rating
07 Oct 2020 at 10:05 AM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
Follow us on Facebook
2022 AnswerTabsTermsContact us