f12 block js code example

Example: right click of mouse and block F12 key

Source: https://www.programmingquest.com/2018/08/prevent-right-click-of-mouse-and-block.html

For preventing Right click Context menu:
 
$(document).on("contextmenu", function (e) {        
    e.preventDefault();
});

For preventing 'F12' and 'Ctrl+Shift+I' button click:
 
$(document).keydown(function (event) {
    if (event.keyCode == 123) // Prevent F12
    { 
        return false;
    } 
    else if(event.ctrlKey && event.shiftKey && event.keyCode == 73)
    // Prevent Ctrl+Shift+I
    {         
        return false;
    }
});