键盘enter进行登录 直接放在JSP中的js里面就可以了 $(document).keypress(function(event){ if(event.keyCode==13){ login(); } });