title: How to count selected files
body: <p>I have very simple form, with input like this:</p>
  
  <pre><code>&lt;input id="my_id" multiple="true" type="file" name="image_name[]" /&gt;
  </code></pre>
  
  <p>Now i have two questions:</p>
  
  <ol>
  <li>how can i count selected files with jQuery or pure JavaScript?</li>
  <li>how can i limit file selection to, let's say 10, because now it's infinite?</li>
  </ol>