title: How to automatically click on a HTML link when opening a new window?
body: <p>I have a small program in JSP which basically when I click on a document, it opens a new window that allows me to view it. The problem here is it would not show the viewer unless I update or install adobe flash player.</p>
  
  <p>I added a hyperlink link where I can easily click on it and it prompts me to "Allow" to view the document which is fine. The hyperlink looks like below:</p>
  
  <pre><code>&lt;a href="https://get.adobe.com/flashplayer" &gt;Enable Flash&lt;/a&gt;
  
  &lt;a href="https://get.adobe.com/flashplayer"&gt;&lt;img border="0" alt="Enable Flash" src="enable_flash.gif"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Now, I have to manually click on it, is there a way I can have the hyperlink auto clicked when the pop up windows shows? </p>
  
  <p>I am new to JavaScript and HTML so I figured there is something that I could use like <code>&lt;body onload &gt;</code> .</p>
  
  <h2>Edit</h2>
  
  <p>This is how my code looks like now:</p>
  
  <pre><code>&lt;body onload="Auto()" &gt; &lt;!--oncontextmenu="return false;"--&gt;
  
  &lt;script&gt;
      function Auto(){
      &lt;a href="https://get.adobe.com/flashplayer" &gt;Enable Flash&lt;/a&gt;
  
          &lt;a href="https://get.adobe.com/flashplayer"&gt;&lt;img border="0" alt="Enable Flash" src="enable_flash.gif"/&gt;&lt;/a&gt;
  
      }
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Am I doing anything wrong?</p>