当前位置:文章中心 >> Jquery_Ajax_Javascript
|
如何在网页中禁用复制、右键、粘贴、剪切
|
夜鹰教程网 来源:www.yyjcw.com 日期:2017-11-20 16:34:02
|
html网页表单中禁用复制、右键、粘贴、剪切等方法
|

这篇文章不能解决你的问题?我们还有相关视频教程云课堂 全套前端开发工程师培训课程 微信号:yyjcw10000 QQ:1416759661 远程协助需要加QQ! 业务范围:视频教程|程序开发|在线解答|Demo制作|远程调试| 点击查看相关的视频教程。 技术范围:全端开发/前端开发/webapp/web服务/接口开发/单片机/C#/java/node/sql server/mysql/mongodb/android/。
|
//屏蔽右键菜单 document.oncontextmenu = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } }
//屏蔽粘贴 document.onpaste = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } }
//屏蔽复制 document.oncopy = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } }
//屏蔽剪切 document.oncut = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if(!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } }
//屏蔽选中 document.onselectstart = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; } catch (e) { return false; } }
|
|
热门服务/教程目录
|
客服电话:153 9760 0032
购买教程QQ:1416759661
|
|
|