开发者

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

开发者 https://www.devze.com 2023-02-16 04:29 出处:网络
I want to change the de开发者_JS百科fault value of <input type=\"file\" /> from “Choose file” to “Browse”. How to do that?Hide it and use a other control to trigger it.

I want to change the de开发者_JS百科fault value of <input type="file" /> from “Choose file” to “Browse”. How to do that?


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;" />


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消