document.onkeydown = function (e) { if (!e) e = window.event; if ((e.keyCode || e.which) == 13) { var obtnLogin = document.getElementById("submit_btn"); //submit_btn为按钮ID obtnLogin.focus(); fun();//提交按钮触发的方法 } }
时间: 2024-10-29 21:14:00
document.onkeydown = function (e) { if (!e) e = window.event; if ((e.keyCode || e.which) == 13) { var obtnLogin = document.getElementById("submit_btn"); //submit_btn为按钮ID obtnLogin.focus(); fun();//提交按钮触发的方法 } }