针对chrome,firefox,IE Enter键跨浏览器提交
jsp页面:
<input id="edit-password" name="user.password" type="password" maxlength="60" required="required" value="${user.password}" οnkeydοwn="return LoginApp.checkKeyDown(event)" class="form-text"/>
js代码:
checkKeyDown:function(evt){
evt = (evt) ? evt : ((window.event) ? window.event : ""); var key = evt.keyCode ? evt.keyCode : evt.which; if(key == 13){ this.login(); } },