js屏蔽BackSpace 返回上一页

onkeydown="empty();"

 

 function empty() {
            if (window.event.keyCode == 8) {
                document.getElementById("Id").value = "";
                window.event.keyCode = 0;
                window.event.returnValue = false;
            }
        }

你可能感兴趣的:(js)