当前位置:网站首页>DOM系列之禁止选中文字和禁止右键菜单
DOM系列之禁止选中文字和禁止右键菜单
2022-07-23 00:09:00 【老__L】
1、禁止鼠标右键菜单
contextmenu主要控制应该何时显示上下文菜单,主要用于程序员取消默认的上下文菜单
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
2、禁止鼠标选中(selectstart 开始选中)
document.addEventListener("selectstart", function (e) {
e.preventDefault();
});
后记
如果你感觉文章不咋地
//(ㄒoㄒ)//,就在评论处留言,作者继续改进;o_O???
如果你觉得该文章有一点点用处,可以给作者点个赞;\\*^o^*//
如果你想要和作者一起进步,可以微信扫描二维码,关注前端老L;~~~///(^v^)\\\~~~
谢谢各位读者们啦(^_^)∠※!!!

边栏推荐
- SIP账号的作用-告诉你什么是SIP线路
- 「建议收藏」常用adb操作命令详解
- User defined type details: structure, enumeration, union
- In depth explanation of CAS is necessary for interview practice
- [ctfshow web getting started]ssrf
- Storage of Graphs~
- jmeter面试话术
- Camera IQ: 76% of consumers have experienced AR, and 49% are willing to share ar advertisements
- 在校生非正常下载2578篇文献,中国社科大IP遭一数据库商封禁
- College students downloaded 2578 documents abnormally, and the IP of the University of Social Sciences of China was banned by a database
猜你喜欢

How do test / development programmers break through? All roads lead to Rome

pinia的基本使用

Print prime numbers between 100 and 200

Camera IQ:76%消费者曾体验AR,49%愿意分享AR广告

用Flutter开发了一个可运行小程序的App

Wireshark packet capture tool basic use
![[GNN report] Huawei Noah lab Zhou Min: graph data modeling and analysis from the perspective of curvature](/img/c7/76512bb3b05ebdce4f60fa84c9236b.png)
[GNN report] Huawei Noah lab Zhou Min: graph data modeling and analysis from the perspective of curvature

微软 Win11/10 软件包管理器 winget 将支持从 zip 文件安装应用

Camera IQ: 76% of consumers have experienced AR, and 49% are willing to share ar advertisements

OSI七层模型有哪七层?每一层分别有啥作用,这篇文章讲的明明白白!
随机推荐
阿里二面:Mysql的索引为什么用B+树而不是跳表?
Intel raid simulator Download
手机键盘(DAY 73)
【MySQL学习】多个不同版本MySQL安装、MySQL8和MySQL5.7同时安装与使用,压缩版
微软 Win11/10 软件包管理器 winget 将支持从 zip 文件安装应用
1.5万字概括ES6全部特性
一套简单完善的WPF管理系统框架源码
day3 poc与exp学习之pikachu带token的暴力破解
实操演练 | MySQL PROCESSLIST 表和 Navicat Monitor 识别慢速查询的简单方法
OSPF的路由控制
[ctfshow-web入门]SSRF
创业文档:催款函怎么写
After planning job hopping for nearly half a year, there were finally four interviews and three interviews
What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?
Network synchronous IO model - IO multiplexing
Flutter 3.0
在校生非正常下载2578篇文献,中国社科大IP遭一数据库商封禁
5 minutes to achieve wechat applet drawing QR code
ospf综合实验配置
HCIP - - - BGP综合实验