title: Prompt user for confirmation when clicking a link
body: <p>I have a link that does some potentially dangerous function (delete something). I want to prompt user if he really wants to do it. I want to do it with javascript and it should be very simple.</p>
  
  <p>My solutions so far:</p>
  
  <pre><code>&lt;a href='/delete' onclick='return confirm("Are you sure?")'&gt;delete&lt;/a&gt;
  </code></pre>
  
  <p>.. is bad in a way that it is not triggered by middle click in Firefox and IE.</p>
  
  <pre><code>&lt;a href='/delete' onmousedown='return confirm("Are you sure?")'&gt;delete&lt;/a&gt;
  </code></pre>
  
  <p>.. does not work. Even if true is returned on clicking Ok, link is not navigated.</p>
  
  <p>What is the correct way to implement this?</p>