How to Disable Right-click on website | Inspect Element

Step 1 : Give a attribute on Body 


    <body oncontextmenu="return false;">

step 2: Paste a code on the bottom of the page


    <script>
        document.onkeydown = function(e){
        if(e.KeyboardEvent == 123){
            return false;
        }else if (e.ctrlKey && e.shiftKey && e.KeyboardEvent == 'I'.charCodeAt(0)) {
            return false;
        }else if (e.ctrlKey && e.shiftKey && e.KeyboardEvent == 'J'.charCodeAt(0)){
            return false;
        }else if (e.ctrlKey && e.KeyboardEvent && 'U'.charCodeAt(0)){
            return false;
            }
        }

    </script>

Leave a Comment