如何在html5输入标签中只选择多个.csv文件?

ome*_*ega 1 javascript csv html5

我使用html5输入标记来仅选择.csv文件.我到目前为止

<input type="file" id="files" name="files[]" accept=".csv" multiple />
Run Code Online (Sandbox Code Playgroud)

但是当我点击浏览时,它会显示所有文件类型.我怎样才能让它发挥作用?

谢谢.

小智 5

尝试:

<input id="fileSelect" type="file" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
Run Code Online (Sandbox Code Playgroud)

或者看看这个解决方案.