title: how to use for-loop to do form submission in javascript?
body: <p>I have written a javascript in the console of chrome to download many files from a web. The javascript is as follows:</p>
  
  <pre><code>for (i=0; i&lt;100; i++) {
  $("input[name=id]").val(i);
  $("form").submit()
  }
  </code></pre>
  
  <p>I expected I can download all the files whose id is from 0 to 99; however, what I am able to download is only the last file (i.e. file with id =99). Why does this happen?</p>