title: How can I make a Chrome extension automatically click a button when a page loads?
body: <p>I'm trying to create a Google Chrome extension that presses a button on page load. I've been able to trigger the button using VBscript for Internet Explorer by using this code:</p>
  
  <pre><code>IE.Navigate("javascript:changeIframe();")
  </code></pre>
  
  <p>But, now I need to do it in Google Chrome via an extension. However, the button does not have an id:</p>
  
  <pre><code>&lt;input type="button" value="Start!" onclick="javascript:changeIframe();"&gt;
  </code></pre>
  
  <p>and here's what I've tried so far and nothing seems to work:</p>
  
  <pre><code>window.onload="javascript:changeIframe()";
  javascript:changeIframe();
  document.getElementById('').click();
  document.getElementById('').submit();
  </code></pre>
  
  <p>It seems that <code>.click</code> and <code>.submit</code> is not defined in Google-Chrome's javascript?</p>
  
  <p>The weird thing is that when I use this script:</p>
  
  <pre><code>javascript:changeIframe();
  </code></pre>
  
  <p>in Chrome's javascript console, it presses the button automatically and everything works fine. But, when I put the same script in my .js file it does not work.</p>
  
  <p>I just need to know what I have to put inside my .js in order to press the button automatically on page load.</p>