Why $("#element").get() is different from $("#element")[0]?
<p>I was doing some tests on html 5 file upload with jquery and ran into something strange (at least to me). I was trying to get the list of files that had been selected in the file control :</p>

<pre><code>&lt;html&gt;&lt;head&gt;
  &lt;meta content="text/html; charset=UTF-8" http-equiv="content-type"&gt;
  &lt;script src="http://code.jquery.com/jquery-1.7.1.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input type="file" multiple="multiple" id="inputFile" name="inputFile"&gt;
    &lt;button onclick="buttonClicked()" type="button"&gt;upload&lt;/button&gt;
&lt;script type="text/javascript"&gt;//&lt;![CDATA[ 
function buttonClicked() {
    console.log($("#inputFile").val()); // depending on the browser, gives either the file name, either the full path, but only for the first file
    console.log($("#inputFile").files); // gives undefined
    console.log($("#inputFile").attr("files")); // gives undefined
    console.log($("#inputFile").get()); // according to the jquery documentation, give the dom element...
    console.log($("#inputFile").get().files); // ...but strangely, files is undefined
    console.log($("#inputFile")[0].files); // on the other hand, this gives me the list of files
}
//]]&gt;;  
&lt;/script&gt;
&lt;/body&gt;&lt;/html&gt;
</code></pre>

<p>So first I was expecting that $("#inputFile").val() would give me that least, too bad that's not the case. So I tried variations on input.files, without really expecting it to work because it didn't seem to fit a jquery object (but hey, you never know). So I tried to get the underlying dom element from jquery to access the files item. And that's where it get strange because it's undefined as well. On the other hand$("#inputFile")[0].files gives the expected result.</p>

<p>[Edit]
And then, as often, while typing that question, I found the solution myself. I'll leave it here anyway, so anyone who struggle on that has a chance to solve it also. It basically goes on RRTFM, like Really RTFM : </p>

<blockquote>
  <p>All of the matched DOM nodes are returned by this call, contained in a
  standard array</p>
</blockquote>

<p>That means, even if there is only one element. So the call:</p>

<pre><code>console.log($("#inputFile").get());
</code></pre>

<p>Was returning an array with one element, and of course arrays don't have a <code>files</code> property. It  should have been:</p>

<pre><code>console.log($("#inputFile").get(0)); 
console.log($("#inputFile").get()[0]); // or this one, but that's a bit silly
</code></pre>
