Disable copy and paste and other operations by disabling the right-click tab.
JS in the button
event 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;
worship