How to Disable Mouse Right Click and Cut Copy Paste in Website

Open your website HTML File. Find </body> tag. Then, just add the following JavaScript code after the </body> tag.

 

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>
<script type="text/javascript">
  jQuery(document).ready(function () {
    // Disable cut copy paste
    jQuery('body').bind('cut copy paste', function (e) {
      e.preventDefault();
    });
    // Disable mouse right click
    jQuery("body").on("contextmenu",function(e){
      return false;
    });
  });
</script>

The file should now look something like this.

Ebook Download
View all
Learn
View all
We offer outsourced software development services for in-house applications across the project