//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.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn