How do you get a HTML Browse button to filter and show only images?

后端 未结 6 2138
星月不相逢
星月不相逢 2021-01-21 09:31

On an HTML page, using the INPUT tag, how can you get it so that when you click the browse button that it filters for image files only? Bonus points if it can include .bmp fil

6条回答
  •  灰色年华
    2021-01-21 10:00

    With the accept attribute, you list the mime types to accept.

    First name:
    Last name:
    Your image:

    Taken from here.

提交回复
热议问题