<body οnkeydοwn="onEnterPress();"> </body> 相应的js代码 function onEnterPress(){ if(event.keyCode ==13){ doLogin(); } }