jQuery - disable context menu right click, cut, copy and paste

jQuery - disable context menu right click, cut, copy and paste

jQuery - disable context menu right click, cut, copy and paste

If You are looking for a simple way to disable right click for any html element then here you will find the best solution to disable right click on page.

There are some reasons why you will disable the right click of mouse button.

It may be you want to show your own menu or you want to prevent user to copy content from your page.

If you want to show your own menu on right click then follow this link :

jQuery making custom right-click context menu example

You can disable right click functionality for whole page too using context menu.

HTML File
  1. <html lang="en">
  2. <head>
  3. <title>jQuery - disable context menu for element example </title>
  4. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
  5. </head>
  6. <body>
  7. <div class="container">
  8. <table border="1">
  9. <tr>
  10. <th>Name</th>
  11. <th>Details</th>
  12. </tr>
  13. <tr class="disableEvent">
  14. <td>ExpertPHP</td>
  15. <td>Provide Online Tutorial</td>
  16. </tr>
  17. <tr class="disableEvent">
  18. <td>Demo</td>
  19. <td>Provide Demo</td>
  20. </tr>
  21. </table>
  22. </div>
  23. </body>
  24. </html>

Script to Disable Mouse Right Click

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $(".disableEvent").on("contextmenu",function(){
  4. alert('right click disabled');
  5. return false;
  6. });
  7. });
  8. </script>

Script to Disable Cut Copy & Paste

Using this script, you can prevent user to cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V)content from your web pages.

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $('.disableEvent').bind('cut copy paste', function (e) {
  4. e.preventDefault();
  5. });
  6. });
  7. </script>

Phone: (+91) 8800417876
Noida, 201301
ataşehir escort maltepe escort bostancı escort kadıköy escort maltepe escort ataşehir escort tuzla escort pendik escort ümraniye escort kartal escort
pendik escort
izmir escort izmir escort izmir escort izmir escort denizli escort antalya escort antalya escort antalya escort izmir escort izmir escort izmir escort izmir escort izmir escort
hatay escort nevsehir escort nigde escort kirikkale escort batman escort osmaniye escort kirklareli escort tokat escort rize escort adiyaman escort gumushane escort batman escort
porno izle
cialis satış cialis fiyat cialis 20 mg cialis 100 mg cialis 5 mg fiyat
sohbet okey oyna
ankara escort marmaris escort bursa escort mersin escort antalya escort izmir escort samsun escort bodrum escort çeşme escort kuşadası escort adana escort eskişehir escort gaziantep escort esenyurt escort pendik escort tuzla escort fatih escort ümraniye escort mecidiyeköy escort kartal escort bahçelievler escort bahçeşehir escort ataşehir escort bakırköy escort nişantaşı escort avcılar escort büyükçekmece escort kurtkoy escort konya escort beşiktaş escort taksim escort beylikdüzü escort malatya escort sakarya escort şişli escort maltepe escort kadıköy escort ataköy escort bostancı escort şirinevler escort bağcılar escort üsküdar escort etiler escort başaksehir escort ortaköy escort kağıthane escort sultangazi escort halkalı escort çekmeköy escort şaşkınbakkal escort mamak escort sincan escort keçiören escort çankaya escort beypazarı escort akyurt escort pursaklar escort kahramankazan escort göztepe escort alsancak escort bornova escort buca escort karabaglar escort karşıyaka escort konak escort narlıdere escort izmit escort başiskele escort kandira escort körfez escort karamürsel escort dilovası escort gölcük escort gebze escort kocaeli escort kayseri escort elazığ escort denizli escort diyarbakir escort adana escort ankara escort izmir escort antalya escort gaziantep escort kayseri escort konya escort mersin escort denizli escort kocaeli escort diyarbakır escort