Inconsistent behavior of Javascript click method on file input element
<p>I have 2 HTML elements:</p>

<pre><code>&lt;input type="file" name="file" id="file"&gt;
&lt;a href="#" id="link"&gt;Click me!&lt;/a&gt;
</code></pre>

<p>and the following jQuery code:</p>

<pre><code>jQuery(document).ready(function() {
    $('#file').click();
    $('#link').on('click',function (e) {
        $('#file').click();
        e.preventDefault();
    });
});
</code></pre>

<p>In Firefox 16 and IE 9, the file selection dialog is opened right after the page finish loading as well as when I click on the link. However, in Chrome, the dialog is only opened when I click on the link.</p>

<p>In this question <a href="http://stackoverflow.com/questions/210643/in-javascript-can-i-make-a-click-event-fire-programmatically-for-a-file-input">In JavaScript can I make a &quot;click&quot; event fire programmatically for a file input element?</a>, Romas mentions that trigger file input is not allowed in Firefox and Opera. </p>

<p>It looks like Firefox allows to do that by now, but I don't understand why Chrome has 2 different behavior for the click method. Is it a bug or just because of implementation?</p>

<p>Hope for your help!</p>
