Right mouse button disable

Disable copy and paste and other operations by disabling the right-click tab.

JS in the buttonevent properties to achieve disable the right mouse button. Replace the right-click tab by popping up a prompt box.

button The event attribute is used when the event is triggered which mouse button is clicked, it returns an integer,

description parameter
Specifies the left mouse button 0
Specifies the middle mouse button 1
Specifies the right mouse button 2
event.button==0|1|2;
function click() {
    
     
	if (event.button==2) {
    
     
		alert('对不起,本页禁用右键!') 
	} 
} 
document.onmousedown=click;

Insert picture description here

worship

Guess you like

Origin blog.csdn.net/Menqq/article/details/115316746