<input type="file" id="file" style="display:none;" accept=".csv"/> <a href="javascript:selectFile()">上传excel文件</a>
function selectFile() { document.getElementById('file').click(); }
<input text="fiel" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
<input text="file" accept=".csv" />
<input text="file" accept="application/vnd.ms-excel"/>
<input type="file" accept="text/plain" />
<input type="file" accept="image/*" />
<input type="file" accept="text/html" />
<input type="file" accept="video/*" />
<input type="file" accept="audio/*" />
上传.pdf格式
<input type="file" accept=".pdf" />