Right-clicking on the html page is prohibited, copying is prohibited, image dragging is prohibited, copying and cutting are prohibited

高洛峰
Release: 2017-02-27 14:56:15
Original
2455 people have browsed it

As we all know, the general method of blocking is to use a script written in JS, but you can also directly block the right click and prohibit copying by modifying the properties of the web page.

Disable right click

oncontextmenu="return false"

Disable copying and cutting:

oncopy="return false; "

oncut="return false;"

Copying prohibited

onselectstart="return false"


Disable image dragging

ondragstart="return false"

Example:


This method can simultaneously prohibit right-clicking, mouse copying, and image dragging

For more html pages, right-clicking is prohibited, copying is prohibited, image dragging is prohibited, copying and cutting are prohibited. For related articles, please pay attention to 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