How to restrict my input type=“file” to accept only png image files not working in Firefox

后端 未结 6 1702
终归单人心
终归单人心 2020-12-05 07:38

I am using input type=\"file\", Now my requirement is that I only want to select png images, that is when I select browse a \"png\" filter should be applied.

I have

6条回答
  •  时光取名叫无心
    2020-12-05 08:09

    The browser support information on that page of w3schools is not correct.

    If you check this page, you see that the accept attribute it's not implemented in Firefox:

    https://developer.mozilla.org/en/HTML/Element/Input

    Update:
    The accept attribute is now implemented in Firefox, but users who don't have a recent version still won't have the support.

提交回复
热议问题