To control how to copy and paste

It is impossible to prevent user to copy and paste on a website. Knowledgeable users can override your HTML source code and JavaScript functions in that they prevent the extraction of information out of your website or add new data in the input controls. However, you can use JavaScript to make it harder for many users to perform copy and paste operations on your website. JavaScript the keystrokes of the user record to determine if copy or paste keys are pressed and inform the user that your site will now allow these actions.


to Control How to Copy-and-Paste' src='/howtodo/eh/image/tech/0768660-how-to-control-copy-and-paste-1.jpg' /> <br />It is impossible to prevent users from copying and pasting on a website. Knowledgeable users can override your HTML source code and JavaScript functions in that they prevent the extraction of information out of your website or add new data in the input controls. However, you can use JavaScript to make it harder for many users to perform copy and paste operations on your website. JavaScript the keystrokes of the user record to determine if copy or paste keys are pressed and inform the user that your site is now these actions.<br /><ul><li>Open Notepad or a word processing program and paste the following code:<br /><!DOCTYPE html PUBLIC http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">

Test blocking of Copy & Paste





This creates an empty HTML document.
  • Add this code after the "" tag:


    This creates a textarea and a text field.
  • Add this JavaScript code after the "




    This creates an empty HTML document.
  • Add this code after the "" tag:


    This creates a textarea and a text field.
  • Add this JavaScript code after the "