Home > Article > Web Front-end > How to shield the right-click menu and left-click scribing functions in Html
This article mainly introduces relevant information about examples of Html blocking right-click menu and left-click swipe function. I hope it can help you.
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">Related recommendations:
Simple example sharing of customizing the right-click menu using JS
js implements the right-click menu function
Implementing right-click menu and drag-and-drop function based on JavaScript
The above is the detailed content of How to shield the right-click menu and left-click scribing functions in Html. For more information, please follow other related articles on the PHP Chinese website!