How to Block Right Clicking with or Without a Message
Put the script (onContextMenu="return false;") right before the > symbol in the HTML tag., Then, try to right click! , If you would like a message to display follow the below steps., Instead of the other script (onContextMenu="return false;") then...
Step-by-Step Guide
-
Step 1: Put the script (onContextMenu="return false;") right before the > symbol in the HTML tag.
For example, it would look like this: <html onContextMenu="return false;"> -
Step 2: try to right click!
, If you are happy you don't have to do anything: , If you want a quote symbol or quote_single symbol, put a forward_slash (/) in front of the quote_single or quote, not the word.
For example: onContextMenu="alert('Oh no you don\'t!');return false;" -
Step 3: If you would like a message to display follow the below steps.
-
Step 4: Instead of the other script (onContextMenu="return false;") then put in this script ( onContextMenu="alert('YOUR MESSAGE HERE');return false;") instead.
Detailed Guide
For example, it would look like this: <html onContextMenu="return false;">
, If you are happy you don't have to do anything: , If you want a quote symbol or quote_single symbol, put a forward_slash (/) in front of the quote_single or quote, not the word.
For example: onContextMenu="alert('Oh no you don\'t!');return false;"
About the Author
Bruce Reyes
A seasoned expert in media and communications, Bruce Reyes combines 1 years of experience with a passion for teaching. Bruce's guides are known for their clarity and practical value.
Rate This Guide
How helpful was this guide? Click to rate: