title: jQuery loop on multiple input.files
body: <p>I need to loop this on a multiple file input:</p>
  
  <pre><code>    var reader = new FileReader();
  
      reader.onload = function (e) {
          $('#pprev_0')
          .attr('src', e.target.result);
      };
  
      reader.readAsDataURL(input.files[0]);
  </code></pre>
  
  <p>I tried this, but it does not work:</p>
  
  <pre><code>var fileCount = 0;
  $("input[name='files[]']").each(function() {
  
      var reader = new FileReader();
  
      reader.onload = function (e) {
          $('#pprev_'+fileCount)
          .attr('src', e.target.result)
          .css("display","block");
      };
  
      reader.readAsDataURL(input.files[fileCount]);
  
      fileCount++;
  });
  </code></pre>
  
  <p>alert() on fileCount output is a one time 0 on multiple file selection. no further alerts. If I take numbers instead of the fileCount var in code, it works at position. r.g. input.files[2] ...</p>
  
  <p>Any idea?</p>