title: Html onmousedown vs href Precedence
body: <p>I use the following code in one of my html pages.
  When user clicks &quot;Search Engines&quot; links it opens yahoo.com on a new page and Google on current page.</p>
  <p>I've tested this and it works (opens both urls), but is there any chance that the page will complete the <strong>window.location</strong> (redirect to a different page) without completing the <strong>href</strong> command?</p>
  <p>Is there a rule for Precedence between the two command?</p>
  <p>**Note: I know I can solve the problem in different ways, but I'm curious about this specific situation.</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
      function clickRedirect() {
          window.location = 'http://www.google.com';
      }
  &lt;/script&gt;
  &lt;body&gt;
  
  &lt;a onmousedown=&quot;clickRedirect()&quot; href=&quot;http://www.yahoo.com&quot; target=&quot;_blank&quot;&gt;Search Engines&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>