Disable Text Selection in Web-Page Or HTML Page
Follow Following Steps To Disable Right Click and Text Selection:
Demo: Try to Right click on This Page
You May like:
- Edit Your HTML Code Of HTML Page
- Find </head> tag.
- Paste following Script Just before it.
- Disable Right Mouse Click
<script type="text/javascript">
$(document).ready(function () {
//Disable full page
$("body").on("contextmenu",function(e){
return false;
});
//Disable part of page
$("#id").on("contextmenu",function(e){
return false;
});
});
</script>
- To Disable Disable CUT/COPY/PASTE
<script type="text/javascript">
$(document).ready(function () {
//Disable full page
$('body').bind('cut copy paste', function (e) {
e.preventDefault();
});
//Disable part of page
$('#id').bind('cut copy paste', function (e) {
e.preventDefault();
});
});
</script>
- Disable Mose Right Click + Copy And Paste
<script type="text/javascript">
$(document).ready(function () {
//Disable cut copy paste
$('body').bind('cut copy paste', function (e) {
e.preventDefault();
});
//Disable mouse right click
$("body").on("contextmenu",function(e){
return false;
});
});
</script>
No comments:
Post a Comment
Notice: Don't add "backlink". Text with Link will automatically Removed.