title: JavaScript: Invoking click-event of an anchor tag from javascript
body: <p>I have a page with an anchor tag. In my JavaScript I am setting the <code>HREF</code> attribute of the anchor tag dynamically based on some if-else conditions. Now I want to invoke the click event of the anchor tag programmatically. I used the below code, but was not successful.</p>
  
  <pre><code>var proxyImgSrc="CostMetrics.aspx?Model=" + model +"&amp;KeepThis=true&amp;TB_iframe=true&amp;height=410&amp;width=650";
  
  document.getElementById("proxyAnchor").href=proxyImgSrc;
  document.getElementById("proxyAnchor").onclick;
  </code></pre>
  
  <p>Can any one tell me how to go ahead? I have a jQuery light box implementation(thickbox) on this link.</p>
  
  <p>Kindly advise. Thanks in advance.</p>