开发者

How to send enter key for logIn

How to send Enter key for logIn in MVC, when I have the following <a id="loginLink" href="#">login开发者_JAVA百科</a>


I do recommend not to use a link in the place of a submit button! But if you insist, you can include this jquery that will handle the enter event for you

$('body').keyup(function(e) {
   if (0 != $('#loginLink').length && e.which == 13) {
      //document.getElementById('formId').submit()
   }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜