We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 575d653 commit c94cd7bCopy full SHA for c94cd7b
超实用的JavaScript代码段/常用表单代码/禁止复制粘贴/banCopyPaste.js
@@ -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
10
+ }
11
+}
超实用的JavaScript代码段/常用表单代码/禁止复制粘贴/index.html
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script src="./banCopyPaste.js"></script>
+ </head>
+ <body>
+ <input type="text" name="banCopyPaste" id="banCopyPaste"/>
+ </body>
+</html>
0 commit comments