jQuery Event Keypress: Which key was pressed?
Actually this is better:
var code = e.keyCode || e.which;
if(code == 13) { //Enter keycode
//Do something
}
Try this
$('#searchbox input').bind('keypress', function(e) {
if(e.keyCode==13){
// Enter pressed... do anything here...
}
});