Is there a way to make text unselectable on an HTML page?
Is there a way to make text unselectable on an HTML page?
Student
Skilled in SEO, content writing, and digital marketing. Completed several years of working in many organizations including multinational companies. I love to learn new things in life that keep me motivated.
Of course, one can disable text selection on an HTML page by using CSS. Here is a way you can dot it:
1. Using CSS
The user-select property stops the user from selecting text. Here's how you can use it:
Apply this class to any element you want to make unselectable:
Important Note
Please understand that this does not give perfect content protection. To get to the text part users can use developer tools or open page source. Limit its usage because it could have a negative side depending on the users.