.on("keydown", function (e) { var curKey = 0, e = e || window.event; curKey = e.keyCode || e.which || e.charCode; if (curKey == 13) 这个js代码简化写法
时间: 2023-03-19 16:24:46 浏览: 229
var curKey = 0;
document.onkeydown = function(e) {
curKey = e.keyCode || e.which || e.charCode;
if (curKey == 13) {
// 按下回车要做的事情
}
}
阅读全文