To secure your images or text sometimes you may want to add some security terms which at least stop normal users to copy your content. It could not stop geeks from stealing your stuff but still, you can cover a wide spectrum of visitors who don’t know more than just right click and select either from “save as image” or “copy”.

disable right click using javascript

disable right click using javascript

You might have done so much research and put much of your time to make such content and collate (*organize) nicely for your users to find something interesting and fresh. But due to cut-throat competition in becoming the best website, some people copy other’s content and use it for their own purpose.

If you are a victim of such problems then you will find this post useful because one code is attached to this post which is a chunk of JavaScript code which could disable the right click event for visitors. So if they don’t know other options then doing just right click on content data and save or copy it. They will find you had added any security mechanism that is blocking them from saving your data.

I know that you are thinking that geeks and computer masters know different ways to steal your data but this is for the normal people which are actually larger in numbers than the geeks and nerds which might be in number that you can even count by fingers only.

The code is very easy and if you know the HTML and JavaScript to some extent then you can understand it in seconds. Still, if you find it difficult in some manner then it is detailed further. The status variable stores the message which will be popped up when the visitor tries to right click on your webpage.

Don’t forget to add the code which is attached to the body tag. If you don’t add that code then this trick will not help you to disable right click in your page.

Please let us know if you have any doubt or confusion in your mind about the trick we will be glad to help you. Thank you and Stay Techie…

About Parth Kheni

Avatar for Parth KheniA Computer Engineer by profession, Parth Kheni is the Founder of TechMuzz. He is an ardent techie and crazy about gadgets. He feels that the apt use of technology simplifies the life to a great extent and thus wishes to take it at every doorstep.

Pin It on Pinterest

Share This