DISABLE MOUSE RIGHT CLICK

chandan sharma

WANT TO DISABLE MOUSE RIGHT CLICK??

Disable mouse right click will prevent visitors from choosing the cut, copy and paste options.

If you want to disable right mouse click for a particular section of a web page, then you can use a selector (#id, .class, etc.) otherwise use body selector for the full page.

The following JavaScript code is used to disable mouse right click.


<script type="text/javascript">
$(document).ready(function () {
    //Disable full page
    $("body").on("contextmenu",function(e){
        return false;
    });
    
    //Disable part of page
    $("#id").on("contextmenu",function(e){
        return false;
    });
});
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *