window.onkeydown = function (event) {
var hasPoint = false;
if (event.keyCode + "" == '8') {
switch (event.target.type) {
case "radio":
case "checkbox":
hasPoint = true;
break;
default:
break;
}
if (event.target.tagName != 'INPUT'
&& event.target.tagName != 'TEXTAREA') {
hasPoint = true;
}
if (event.target.readOnly == true) {
hasPoint = true;
}
if (hasPoint == true) {
window.event.keyCode = 0;
window.event.returnValue = false;
return false;
}
}
}
JS屏蔽Backspace跳转网页
最新推荐文章于 2024-01-02 00:00:57 发布