Home > Article > Web Front-end > How to use Html to block the right-click menu and left-click swipe function
This article mainly introduces relevant information about examples of Html blocking right-click menu and left-click swipe function. The content is quite good. I will share it with you now and give it as a reference.
Disable right-click menu
<body oncontextmenu=self.event.returnValue=false>
Disable left-click copying
<body onselectstart="return false">
Use CSS to control whether text can be selected
.unselectable { user-select: none; } <p>You can select me.</p> <p class="unselectable">You can't select me!</p>
Disable right-click menu and left-click copy function
<body oncontextmenu=self.event.returnValue=false onselectstart="return false">
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
Set the font color of the hyperlink and the font color after clicking through HTML
Remove the HTML Inline-Block's blank method
The above is the detailed content of How to use Html to block the right-click menu and left-click swipe function. For more information, please follow other related articles on the PHP Chinese website!