javascript / dhtml
Return to Index
Disabling the Right Mouse (Right-Click) Button
About This Demo...

This demo is in a pop up... so CLICK HERE.

On the pop-up demo, try both left-click and right-click with your mouse.

Right-click will trigger an alert box; and the user cannot gain access to your source code or any other functions on the right-click context menu.

Left-click will allow all of the usual functions to work completely normally.

Suggested Uses & Use Notes

The most common use of this techniques is to prevent users from seeing the source code of the page; but it's also useful if you wish to disable other right-click context menu functions, as well.

Note that this technique only works in MSIE.  NS just completely ignores it. For a somewhat more advanced script that works with Netscape, as well, see the JavaScript section at www.CodeLifter.com .

The Code & Instructions...

Click HERE to Select the Code.  (Pressing Ctrl+C will then place it in your Clipboard.)


Return to Index
Copyright 1996-2004 by CodeBrain.com
All Rights Reserved