Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过以下
<input type="file" name="upload" multiple="multiple" value="MyText">
但是我的按钮上的文本仍然显示“选择文件”。我究竟做错了什么?
值用于文本输入目的。按钮输入类型是提交。您可以为此使用 javascript。
值仅适用于文本输入、按钮和具有 sumbit 类型的输入,如果没有一些 javascript,您真的无法调整输入类型文件。
输入类型=“文件”由浏览器预先定义。您无法更改它,但如果您想尝试,这里有一篇好文章。
http://www.quirksmode.org/dom/inputfile.html