JS-
JS-

Reputation: 957

How can I use change & keyup together

This is not working as expected. How can I make this code work in as less lines as possible?

$('selector').on('change, keyup', function() {
   // some code 
});

Upvotes: 0

Views: 37

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388446

There should not be the , between the event names

$('selector').on('change keyup', function() {
   // some code 
});

Upvotes: 4

Related Questions