javascript - multiple .on events AND detecting keypress -


i run function this:

$(document).on('change, focusout', '.something', function(){ ... } 

i handler execute when keypress == 13. what's best approach?

do if statement

$(document).on('change focusout keypress', '.something', function(e){ if(e.keycode == 13 ) { //code here }  }); 

Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

SoapUI on windows 10 - high DPI/4K scaling issue -

java - why am i getting a "cannot resolve method" error on getApplication? -