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
Post a Comment