If we want to prevent the user from copying content from a web page,
we need to disable right click and also we need to disable the copy, cut,
paste options.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<!--Javascript code for disable right click-->
<script>
$(document).ready(function(){
$(document).on("contextmenu",function(e){
return false;
});
});
</script>
<!--Javascript code for disable cut,copy,paste-->
<script>
$(document).ready(function(){
$(document).on("cut copy paste",function(e){
return false;
});
});
</script>
</head>
<body>
1. contextmenu (also called contextual, shortcut, and pop up or pop-up menu) is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation.
2. The on( ) method attaches one or more event handlers for the selected elements and child elements like cut, copy, paste.
</body>
</html>
If we want to prevent the user from copying content from a web page,
we need to disable right click and also we need to disable the copy, cut,
paste options.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<!--Javascript code for disable right click-->
<script>
$(document).ready(function(){
$(document).on("contextmenu",function(e){
return false;
});
});
</script>
<!--Javascript code for disable cut,copy,paste-->
<script>
$(document).ready(function(){
$(document).on("cut copy paste",function(e){
return false;
});
});
</script>
</head>
<body>
1. contextmenu (also called contextual, shortcut, and pop up or pop-up menu) is a menu in a graphical user interface (GUI)
2. The on( ) method attaches one or more event handlers for the selected elements and child elements like cut, copy, paste.
</body>
</html>