title: How to Disable Copy Paste (Browser)
body: <p>I am trying 2 alternatives:</p>
  
  <ul>
  <li>Ignore right-click</li>
  <li>Ignore <kbd>ctrl</kbd> + <kbd>C</kbd>, <kbd>ctrl</kbd> + <kbd>A</kbd></li>
  </ul>
  
  <p>This is my code:</p>
  
  <pre><code>function noMenu() {
    return false;
  }
  function disableCopyPaste(elm) {
    // Disable cut/copy/paste key events
    elm.onkeydown = interceptKeys
    // Disable right click events
    elm.oncontextmenu = function() {
      return false
    }
  }
  function interceptKeys(evt) {
    evt = evt||window.event // IE support
    var c = evt.keyCode
    var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support
    // Check for Alt+Gr (http://en.wikipedia.org/wiki/AltGr_key)
    if (ctrlDown &amp;&amp; evt.altKey) return true
    // Check for ctrl+c, v and x
    else if (ctrlDown &amp;&amp; c==67) return false // c
    else if (ctrlDown &amp;&amp; c==86) return false // v
    else if (ctrlDown &amp;&amp; c==88) return false // x
    // Otherwise allow
    return true
  }
  </code></pre>
  
  <p>And this is my HTML:</p>
  
  <pre><code>&lt;body class="node88" oncontextmenu="return noMenu();" onkeydown="return disableCopyPaste();"&gt;
  </code></pre>
  
  <p>The <code>noMenu()</code> function is working, but <code>disableCopyPaste()</code> doesn't work.</p>