title: How can I programmatically invoke an onclick() event from a anchor tag while keeping the ‘this’ reference in the onclick function?
body: <p>The following doesn't work... (at least not in Firefox: <code>document.getElementById('linkid').click()</code> is not a function)</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function doOnClick() {
          document.getElementById('linkid').click();
          //Should alert('/testlocation');
      }
  &lt;/script&gt;
  &lt;a id="linkid" href="/testlocation" onclick="alert(this.href);"&gt;Testlink&lt;/a&gt;
  </code></pre>