登录框中偶尔用下event.keyCode==13按键事件
<input type="text" name="passwd" onkeydown="if(event.keyCode == 13)alert("登录");"/>