How to change “Choose file” into “Browse”?

2019-01-21 19:58发布

I want to change the default value of <input type="file" /> from “Choose file” to “Browse”. How to do that?

3条回答
干净又极端
2楼-- · 2019-01-21 20:25

Here is another solution; hiding file-type input field (button) and placing another regular button-type input field (button) which allows one to change its content - triggering first file button (lower one) is done with JavaScript clicking on second regular button (upper one).

Howto Style the Button of a input type="file" Control

查看更多
叛逆
3楼-- · 2019-01-21 20:40

Hide it and use a other control to trigger it.

<a href="#" onclick="document.getElementById('fileID').click(); return false;" />Browse</a>
<input type="file" id="fileID" style="visibility: hidden;" />
查看更多
乱世女痞
4楼-- · 2019-01-21 20:41

I created a jsFiddle to show how, you can find it here: Custom browse button

查看更多
登录 后发表回答