//Listen to the Enter key auto-submit event
function keyboardEvent(event){
var keyCode=event.keyCode ? event .keyCode:event.which?event.which:event.charCode;//Solve the difference between browsers
if(keyCode==13){
submitForm();
}
}
jQuery discards the standard button attribute in favor of which, which is a bit puzzling.
which is introduced by Firefox and is not supported by IE. The original intention of which is to obtain the key value (keyCode) of the keyboard.
Which in jQuery can be the key value of the keyboard or the key value of the mouse.