How to Disable Right Click, Cut, Copy And Paste Using jQuery

AuthorSumit Dey Sarkar

Pubish Date26 Aug 2022

categoryJQuery

In this article we will learn how to disable right click, cut, copy and paste using jQuery.

Here we wil use context menu for disable mouse right click and also use bind event with cut copy paste oparation to disable cut copy paste using jQuery.

let's see the example - 

How to disable right click, cut, copy and paste using jQuery

<!DOCTYPE html>
<html>

<head>
  <title>How to disable right click, cut, copy and paste using jQuery</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>

<body>

  <h1>How to disable right click, cut, copy and paste using jQuery</h1>

  <script>
    $(document).ready(function () {
      //Cut copy paste disable
      $(document).bind('cut copy paste', function (e) {
        e.preventDefault();
      });

      //Mouse right click disable
      $(document).on("contextmenu", function (e) {
        return false;
      });
    });
  </script>

</body>

</html>
Comments 0

Leave a comment