An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
April 13, 2022 04:44 am GMT
Original Link: https://dev.to/codewithsnowbit/how-to-disable-right-click-on-your-website-5dca
How to disable right-click on your website?
Disabling right-click on websites provides basic security so that people don't save images and copy links and text.
Today, in this article I will show you how you can also disable rick-click on your website.
Let's disable the right-click
To disable right-click on the website, we have to deal with JavaScript. It's pretty simple to disable right-click. Let me show you...
document.addEventListener('contextmenu', event => event.preventDefault());
Tada! Right-click has been disabled on your website
Conclusion
I hope this blog post has helped you understand how to disable right-clicking on websites.
Lets connect
If you found my content helpful and would like to thank me, feel free to Buy me a coffee :)
Have a great day!
Original Link: https://dev.to/codewithsnowbit/how-to-disable-right-click-on-your-website-5dca
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To