Created
May 21, 2019 23:37
-
-
Save techmuzz/e4a3ca495d110b1abcd6deba94574490 to your computer and use it in GitHub Desktop.
Disable Right Click In Web Page Using JavaScript - https://www.techmuzz.com/how-to/mashup/disable-right-click-web-page-using-javascript/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
document.onmousedown=disableclick; | |
var status="Right Click Disabled"; | |
function disableclick(event) | |
{ | |
if(event.button==2) | |
{ | |
alert(status); | |
return false; | |
} | |
} | |
</script> | |
</head> | |
<body oncontextmenu="return false"> | |
<img width="100%" height="auto" src="http://www.techmuzz.com/wp-content/uploads/2014/06/robo-Copy-2.png"/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment