JavaScript:oncontextmenu使页面内右键菜单失效

在html页面上右击,会弹出菜单选项,下面令其失效,不管怎么右键,都不会出现以上菜单

<!DOCTYPE html>
<html>
<head>
	<title>右键菜单失效</title>
<script type="text/javascript">
	document.oncontextmenu = function(){
		return true;
	}
</script>
</head>
<body>

</body>
</html>
发布了126 篇原创文章 · 获赞 7 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_36880027/article/details/104360883