In previous article we learned how to prevent our blog content from copying by disabling right click on web page. Now in this article i will show you how to disable content selection on web page using jQuery.
To disable content selection on web page follow these steps
Include jQuery in your web page
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Insert following code in head section
$(function(){ $(document).attr('unselectable','on') .css({'-moz-user-select':'-moz-none', '-moz-user-select':'none', '-o-user-select':'none', '-khtml-user-select':'none', '-webkit-user-select':'none', '-ms-user-select':'none', 'user-select':'none' }).on('selectstart', function(){return false; }); });
Pingback: Disable right click on web page using jquery | Web Tools