Validate image type using javascript
<p>i have a form like this: </p>

<pre><code>&lt;form method=post src=upload enctype="multipart/form-data"&gt;
    &lt;input name="img1" id="img1" type="file"&gt;
    &lt;input type="submit" value="Upload"&gt;
&lt;/form &gt;
</code></pre>

<p>Please how can I valid this form using javascript so that only jpg files are uploaded. thanks for reading.</p>
