jQuery Plugin To Disable Copy/Paste In Web Pages - PastePreventer

jQuery Plugin To Disable Copy/Paste In Web Pages - PastePreventer
File Size: 4.87 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

PastePreventer is a cross-browser and mobile-first jQuery plugin which prevents the users from Copy and Paste function in your webpages.

How to use it:

1. Load the jQuery PastePreventer plugin's script after you have jQuery library loaded.

<script src="//code.jquery.com/jquery-3.1.0.min.js"></script>
<script src="pastepreventer.js"></script>

2. Call the function and specify the container in which you want to disable the paste function.

$(".demo").blockCopy({
  blockPasteClass : "prevent-paste"
});

3. Customize the text message if your user tries to paste.

$(".demo").blockCopy({
  blockPasteClass : "prevent-paste",
  message:"Shame on you!"
});

This awesome jQuery plugin is developed by JafarAkhondali. For more Advanced Usages, please check the demo page or visit the official website.