How to Disable Text Selection on an HTML Web Page using JQuery?


Disable select and copy-paste on the website with Jquery which prevents content from being stolen from your website with unselectable HTML attribute, CSS user-selectable property, and JavaScript select start event.

disable text selection jquery, enable text selection javascript, how to disable text selection in web page, disable text selection css, disable text selection html, disable text selection in input field

How to make use of it:

1. Copy and paste the next JS snippets after jQuery.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
  $.fn.disableSelection = function() {
    return this
    .attr('unselectable', 'on')
    .css('user-select', 'none')
    .on('selectstart', false);

2. Disable text choice on the whole web page.


3. Or on a selected container.


Prevent Content Theft By Disabling Text Selection, diable-selection tool Plugin/Github, how to protect your website content from being copied, how to disable text selection

See Demo And Download

Official Website(habeebuddinhuzaifa): Click Here

This superior jQuery/javascript plugin is developed by habeebuddinhuzaifa. For extra Advanced usage, please go to the official website.