With jQuery, how do I find out which key was pressed when I bind to the keypress event?
$(\'#searchbox input\').bind(\'keypress\', function(e) {}); >
$(\'#searchbox input\').bind(\'keypress\', function(e) {});
Actually this is better:
var code = e.keyCode || e.which; if(code == 13) { //Enter keycode //Do something }