title: HTML5: How to count the length of the files from the multiple-input field
body: <p>How can I use jquery to count the length of the files from the multiple-input field?</p>
  
  <pre><code>alert($('#myForm input[type=file]').files.length);
  &lt;input type="file" multiple="multiple" name="file[]"/&gt;
  </code></pre>
  
  <p>error:</p>
  
  <blockquote>
    <p>$("#myForm input[type=file]").files is undefined</p>
  </blockquote>
  
  <p>It works find with plain js but I don't want to use ID in my input field.</p>
  
  <pre><code>alert(document.getElementById('file').files.length);
  
  &lt;input type="file" multiple="multiple" name="file[]" id="file"/&gt;
  </code></pre>