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

});

Share on FacebookShare on TwitterShare on LinkedInSend email
1 answer
x
x
2024 AnswerTabsTermsContact us