JS禁用键盘、鼠标操作
//键盘keyCode值对照表
<html>
<head>
<title>JS禁用键盘、鼠标操作</title>
</head>
<!--禁用键盘开始-->
<script language="JavaScript">
document.onkeydown=function(){
with(window.event){
//Ctrl + S keyCode == 83
//F12 keyCode == 123
if (event.ctrlKey && event.keyCode == 83)
{event.keyCode=0;event.returnValue=false;}
}
}
</script>
<!--禁用键盘结束-->
<!--禁用鼠标右键-->
<body oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false" >
<center>微笔记_博客</center>
</body>
</html>
文章来源:微笔记_博客