需要在其页面上添加<body></body>,在body里面调用<body οnkeydοwn="return onkeydownBody()"> 方法 js如下:
<script>
function onkeydownBody() {
if (event.keyCode == 8) {
if (document.activeElement.type == "text") {
if (document.activeElement.readOnly == false)
return true;
}
return false;
}
}
</script>