首页 > 代码库 > js按Enter键提交表单

js按Enter键提交表单

function exprint(e){
  /* var keycode = event.keyCode;
  if (keycode == "13"){
    fm.UserCode.focus();
    submitForm();
  } */
  e = e ? e : window.event;
  var keyCode = e.which ? e.which : e.keyCode;
  if(keyCode == 13) {
    submitForm();
  }
}

js按Enter键提交表单