Is there a way to disable inspect element

Is there a way i can block inspect element for my nextcloud instance?

i tried adding following in index.php but it doesn’t work

$(document).bind("contextmenu",function(e) {
 e.preventDefault();
});
$(document).keydown(function(e){
    if(e.which === 123){
       return false;
    }
});