Javascript get number of files and their filenames from file input element with multiple attribute?

前端 未结 3 737
逝去的感伤
逝去的感伤 2020-11-27 03:30

I have a file input with the multiple=\"multiple\" attribute to allow users to select multiple files at once. I would like to display selected file names and th

3条回答
  •  醉话见心
    2020-11-27 04:03

    The second answer was wrong.

    Answer should be document.getElementById('fileElementId').files.length; instead of document.getElementById('fileElementId').files;.

提交回复
热议问题