首页 > 技术文章 > 按回车键提交表单

hgj123 2017-01-24 09:34 原文

document.onkeydown = function (e) {
var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which;
if (code == 13) {
$("#add_submit").click();
}
}

推荐阅读