title: How to disable right-click context-menu in JavaScript
body: <p>Not that I'm trying to prevent 'View Source' or anything silly like that, but I'm making some custom context menus for certain elements.</p>
  
  <p>EDIT: response to answers: I've tried this:</p>
  
  <pre><code>&lt;a id="moo" href=''&gt; &lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      var moo = document.getElementById('moo');
  
      function handler(event) {
          event = event || window.event;
  
          if (event.stopPropagation)
              event.stopPropagation();
  
          event.cancelBubble = true;
          return false;
      }
  
      moo.innerHTML = 'right-click here';
  
      moo.onclick = handler;
      moo.onmousedown = handler;
      moo.onmouseup = handler;
  &lt;/script&gt;
  </code></pre>