Disable right click and text select using jquery and css

If you need to prevent user from selecting text or right click use below jquery code and css code

Put below Jquery code in your page

<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script>
//// Disable right click
			jQuery(document).bind('contextmenu', function (e) {
			  e.preventDefault();
			 // alert('Right Click is not allowed');
			}); 
</script> 

Put below CSS code in your css file


 body {
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none; }

Online Web Development Training,Video Tutorials