Skip to content

Commit c94cd7b

Browse files
committed
禁止控件内的内容复制黏贴
1 parent 575d653 commit c94cd7b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
window.onload = function(){
2+
var element = document.getElementById("banCopyPaste");
3+
4+
element.onpaste = function(){
5+
return false;
6+
};
7+
8+
element.oncopy = function(){
9+
return false;
10+
}
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+
<script src="./banCopyPaste.js"></script>
5+
</head>
6+
<body>
7+
<input type="text" name="banCopyPaste" id="banCopyPaste"/>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)