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(){

});
02 Oct 2020 at 06:42 PM
0pnshow more
StorStor
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(){

});

07 Oct 2020 at 10:05 AM
0pnshow more
TimTim
Share on FacebookShare on TwitterShare on LinkedInSend email
Follow us on Facebook & Twitter
2021 AnswerTabsTermsContact us