title: How to simulate key presses or a click with JavaScript?
body: <p>I wrote a Google Chrome extension and the site that I want to use my extension on requires me to click or tab onto a text box (because I think it runs javaScript verification "onClick" only). I can get the text in the box with my extension using: </p>
  
  <pre><code>document.getElementById("input1").value = 'test';
  </code></pre>
  
  <p>But when I click submit, it thinks I did not enter anything in the "input1" text box because I never clicked it or tabbed on it. </p>
  
  <p>Can someone help me get around this?</p>