禁用某个keycode操作 小潘东 2017-12-14 195 阅读1分钟 <html> <head> <title>Title</title> </head> </body> <script type="text/javascript"> function disableBack() { if(event.keyCode==32) // 禁用空格键 return false; } document.onkeydown=disableBack; </script> </html>