Window.Event.KeyCode=13是enter键处发windows事件,enter键的ASCII是13。
<input type="password" name="login_password" id="login_password" class="form-control" placeholder="请输入密码" onkeydown="javascript:if (event.keyCode==13) LoginByBeatEnter();" /> <script type="text/javascript"> function LoginByBeatEnter() { $(‘#login‘).click(); } </script>