禁用某个keycode操作
2017-05-21 本文已影响8人
野狗子嗷嗷嗷
<html>
<head>
<title>Title</title>
</head>
</body>
<script type="text/javascript">
function disableBack()
{
if(event.keyCode==32) // 禁用空格键
return false;
}
document.onkeydown=disableBack;
</script>
</html>