title: How do I submit a form in Javascript with a delay
body: <p>I am trying to submit the form automatically with a delay in a chrome extension I am writing and it does not seem to be submitting. Below is my form and javascript: </p>
  
  <pre><code>function submitForm() { // submits form
      document.getElementById("ismForm").submit();
  }
  
  if (document.getElementById("ismForm")) {
      setTimeout("submitForm()", 5000); // set timout 
  }
  
  
  &lt;form method="post" id="ismForm" name="ismForm" action="http://www.test.com" class=""&gt; 
  &lt;label for="searchBox"&gt;Search &lt;/label&gt;
  &lt;input type="text" id="searchBox" name="q" value=""&gt; &lt;input type="hidden" id="sayTminLength" value="3"&gt;&lt;input type="hidden" id="coDomain" value="US"&gt;&lt;input class="button" type="submit" id="search.x" name="search.x" value="Search" autocomplete="off"&gt; 
  &lt;/form&gt;
  </code></pre>