| Programming C# C++ (7) Delphi (604) Java (8) JavaScript (55) Document (8) Events (8) Strings (3) perl (40) php (12) VBScript (1) Visual Basic (1) |
Disable text selection with the mouse
(1 votes). Leave comments and/ or rate it.
Question: How can I disable text selection by mouse clicking or dragging of a text block?Answer: You could disable any mouse-down event with code as shown below (to be put in an onload event. The downside of this is that nothing will work anymore, not even clicks on links.Also know that a user still can click on the document and use 'Select All' from the Edit menu (or in Internet Explorer even use a shortcut Control+A), followed by 'Copy' from the menu. There is simply no way to protect displayed content, you can only make it a bit more difficult.
Comments:
|