经测试keypress不触发退格事件,只有keyup,keydown触发
$('input').on("keyup", function (e) {
var e = e ? e : event;
var k = e.keyCode || e.which;
if (k == 8) {
console.log(111);
}
});
经测试keypress不触发退格事件,只有keyup,keydown触发
$('input').on("keyup", function (e) {
var e = e ? e : event;
var k = e.keyCode || e.which;
if (k == 8) {
console.log(111);
}
});