Making text unselectable is an easy task. All we have to do is to disable the selectivity of the text on our webpage for all the browsers that the webpage is likely to be loaded on. There are some settings/commands used in CSS which are used for enabling/disabling functionalities on specific browsers. Like to disable a certain functionality on our webpage say disabling the selectivity of the text, we will have to disable it for all the available browsers separately else, it will not be applicable on all the browsers.
Let us see what statements do we use for different browsers to disable a selectivity of text.
- Chrome, Opera: -webkit-user-select
- Safari: -webkit-touch-callout
- Mozilla: -moz-user-select
- Internet Explorer: -ms-user-select
Note The text present in the “disable-text” div will not be selected and rest everything is selectable as shown in the output image.
- How to disable the modification of text canvas using Fabric.js ?
- How to disable a link using only CSS?
- How to disable resizable property of textarea using CSS?
- How to disable zoom on a mobile web page using CSS?
- How to disable input type text area ?
- Text Animation with changing the color of the text using HTML & CSS
- How to create long shadow of text without using text-shadow in HTML and CSS ?
- How to disable a CSS :hover effect?
- D3.js selection.text() Function
- How to enable/disable all input controls inside a form element using jQuery ?
- How to disable Copy, Paste, Cut and Right Click using jQuery ?
- How to disable scrollbar without hiding using jQuery ?
- How to disable form submit on enter button using jQuery ?
- How to make sure clients have enough words in textarea by using angularjs in order to disable/enable a button?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh