jquery click enter to submit by default

//When doing program development, it is often necessary to use the default form submission when clicking Enter, which is the most commonly used when logging in!
$(document).keydown(function(e){
   if(e.keyCode == 13){
    $('#inputForm').submit();
   }
  });

But found in IE8 and Firefox if you use
<input type ="submit" value="login"/> or
<input type="image" value="login"/>, then click enter to trigger submission by default! It feels smarter! ! ! ! !

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326446887&siteId=291194637