title: How can I programmatically open the file picker with JavaScript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/210643/in-javascript-can-i-make-a-click-event-fire-programmatically-for-a-file-input">In JavaScript can I make a &ldquo;click&rdquo; event fire programmatically for a file input element?</a>  </p>
  </blockquote>
  
  
  
  <p>I have naively tried the following to open the file picker programmatically with JavaScript (see fiddle <a href="http://jsfiddle.net/fEBFp/" rel="nofollow noreferrer">here</a>):</p>
  
  <pre><code>&lt;input type='file'&gt;​
  
  &lt;script&gt;
      $(function () {
          $('input').click();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The above doesn't work. How can I open the file picker of a <code>input type='file'</code> with JavaScript?</p>