File input: Compare file type and accept only picture formats (jpg, bmp, etc)
<p>I am currently trying ot find a way to use jquery to validate if a a file is in picture format <code>(jpeg,jpg,bmp,gif,etc)</code>. I have been able to figure out if the input is empty or not with simple <code>.length</code> comparison. How would I be able to check the file type and only accept valid picture formats.</p>

<p><strong>Emtpy or not input:</strong></p>

<pre><code>if ($.trim($('#textInput').val()).length == 0) {
    alert("Should Not Be Empty!");
}
</code></pre>
