How to shield the right-click menu and left-click scribing functions in Html

小云云
Release: 2018-03-12 09:55:49
Original
2587 people have browsed it

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>
Copy after login

Disable left-click copying


##

<body onselectstart="return false">
Copy after login

Use CSS to Control whether text can be selected


.unselectable {
  user-select: none;
}
<p>You can select me.</p>
<p class="unselectable">You can&#39;t select me!</p>
Copy after login

Disable right-click menu and left-click copy function


<body oncontextmenu=self.event.returnValue=false onselectstart="return false">
Copy after login
Related recommendations:


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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!