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) {});
Some browsers use keyCode, others use which. If you're using jQuery, you can reliably use which as jQuery standardizes things. Actually,
$('#searchbox input').bind('keypress', function(e) { if(e.keyCode==13){ } });