title: JS: detect right click without jQuery (inline)
body: <p>I'm calling a function, that builds a table which includes several links.</p>
  
  <p>I want to check if a link has been clicked with right or left mouse.</p>
  
  <p>I tried to add the following part to the <code>&lt;a&gt;</code> hyperlink.</p>
  
  <pre><code>onmousedown="function mouseDown(e){
  switch (e.which) {
     case 1: alert('left'); break;
     case 2: alert('middle'); break;
     case 3: alert('right'); break; }
  }"
  </code></pre>
  
  <p>But nothing happens If I click on a link.</p>