The function is very simple and the code is also very concise. There will be no more nonsense here. I will provide the source code directly and friends who need it can take it away directly.
document.onkeydown =document.onkeyup = document.onkeypress=function(){
if(window.event.keyCode == 123) {
window.event.returnValue=false;
return(false);
}
}
<--123——112 is the code number of F1-F12-->
This is so that others don’t look at your code. For those who don’t understand, if you are an experienced person, you can’t prevent it!