Prevent copying text in web-page

Note that this question might be found via Google by people who want to override a no-copy rule via a Greasemonkey script or the like on the browser side.

In addition to select disabling, I've seen the following tactic in at least one website:

<body oncopy="return false" onpaste="return false" oncut="return false">...</body>

Here: How to disable text selection highlighting using CSS?

-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;

Disallow them from being able to answer when the window's onBlur event is fired. They can still use other devices, but they won't be able to cheat on the same computer.


There is no good way to do this. A cheater will be able to work around pretty much everything.

The only thing that comes to mind is to output the questions as dynamically generated images. That would protect against copy-pasting. You'll have to decide how much of a protection that really is, though - most short questions can be typed into Google in no time, can't they?


In your div tag where you paste your question, add the following line of code:

<div id="test" onmousedown='return false;' onselectstart='return false;'>

This will prevent copying of anything that is within the tags...