- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to disable copy content function using jQuery?
To disable cut, copy and paste of a content in jQuery, use the jQuery bind() function.
Example
You can try to run the following code to disable copy paste of content using jQuery −
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('#mytext').bind("cut copy paste",function(e) { e.preventDefault(); }); }); </script> </head> <body> <input type = "text" id="mytext">Copy, cut and paste function doesn't work here. </body> </html>
- Related Articles
- How to copy the content of a div into another div using jQuery?
- How to disable right click using jQuery?
- How to print div content using jQuery?
- How to globally disable an animation using jQuery?
- How to enable and disable submit button using jQuery?
- How to get HTML content of an element using jQuery?
- How to get the value of div content using jQuery?
- How to replace the content of an element using jQuery?
- How to set HTML content of an element using jQuery?
- How to get the content of a textarea using jQuery?
- How to set the content of a textarea using jQuery?
- How to disable copy/paste from/to EditText in Android App using Kotlin?
- How to produce your content hard to copy
- How to disable/ enable checkbox with jQuery?
- How to insert content after each of the matched elements using jQuery?

Advertisements