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

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

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