6.怎样获取回车事件,并对进行相应的操作

时间:2021-11-03 23:48:42

$(document).ready(function () {

document.onkeydown = getKeyCode;

});

 

 

//去除回车键盘事件
function getKeyCode(e) {
var keyCode = 0;
var e = e || window.event;
keyCode = e.keyCode || e.which || e.charCode;
if (keyCode == 13) //回车键是13
{
$('#import').form({
onSubmit: function () {
return false;
}

});
}
}