Copy the codeThe code is as follows:
<li class="item pin">
<span class="overlabel" style="display: block;">Please enter the verification code</span>
<input type="text" class="txt" name="checkNum" maxlength="4" onkeydown="keyboardEvent(event);" />
<img src="${basePath}/randomImageCodeStyle" width="60" height="28" title="Click to reload verification code" style="cursor: hand" />
</li>
Copy the codeThe code is as follows:
// Listen to the Enter key to automatically submit events
function keyboardEvent(event){
var keyCode= ? :?:;//Solve the problem of differences between browsers
if(keyCode==13){
submitForm();
}
}
jQuery discards the standard button attribute to adopt which, which is a bit confusing.
Which is introduced by Firefox and is not supported by IE. The original intention of which is to obtain the keycode of the keyboard.
Which in jQuery can be the keyboard key value or the mouse key value.