简体   繁体   中英

How to change the button text of input type=“file” element

Well I am developing a simple page in html, in which I am using input element type="file" . By default we get a textbox and a button to browse a file from the system. Default label of this button is Browse. But I want to change the label of this button with some other name, like 'Open' or 'Select File'. But I don't have any idea how to accomplish this.

Does anyone know how to do this?

You have to use an image and overlay it on top of the button. then use Javascript to clone the file click onto the image. Does this even make sense? I'm a bit hungover.
Anyway, here's a ncie jQuery plugin http://www.appelsiini.net/projects/filestyle/demo.html

You can't. You could if you would use Flash or Java for handling file uploads.

您无法更改文件控件“浏览”文本,如果您使用jquery文件上传,则可以执行此操作...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM