JSFiddle - React, Tailwind, and code Playground

HTML

<form action="">
  <input type="file" name="pic" accept=".png, .jpg, .jpeg">
  <input type="submit">
</form>

<p><strong>Note:</strong> The accept attribute of the input tag is not supported in Internet Explorer 9 (and earlier versions), and Safari 5 (and earlier).</p>
<p><strong>Note:</strong> Because of security issues, this example will not allow you to upload files.</p>