CSS
How To Disable Text Selection On Html Web Page Using JQuery & CSS?
Here, we will discuss how to disable text selection on website page using jquery. we can also disable content selection using css and jquery. here i will give you more examples to disable text selection on a web page using jquery and css.
- 4.5/5.0
- Last updated 08 September, 2022
- By Admin
I given first i will give you simple example of disable text selection on website jquery using css property. you need to just add some css on your body tag as you can see on bellow example example code. you can simply copy and check that.
Example 1 - Disable text selection on web page in HTML using CSS
disable selection of text on web page - codewale.com How to disable text selection on html web page using JQuery?
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Second example i will give you simple core jquery. we can create our own disableSelection() jqurey function and we will use it on body tag. so you can also check bellow code for that.
Example 2 - disable selection of text on web page using JQuery
disable selection of text on web page - codewale.com How to disable text selection on html web page using JQuery?
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
In Third Example, we will use jquery ui. as we know jquery ui provide several function that amazing. in this example we will use disableSelection() for disable text selection on website jquery, so let's see bellow code:
Example 3 - disable text selection on website jquery ui
disable text selection on website jquery - codewale.com How to disable text selection on html web page using JQuery?
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
I hope it can help you...