Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 733
user634850 Avatar asked Mar 12 '11 08:03

user634850


People also ask

How do I change the Choose file button in css?

You can simply use ::-webkit-file-upload-button in css and style your Choose file button.

How do I customize the Choose file button in HTML?

The best approach would be to have a custom label element with a for attribute attached to a hidden file input element. (The label's for attribute must match the file element's id in order for this to work). In terms of styling, just hide1 the input element using the attribute selector.

How do I browse files in HTML?

The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute.


1 Answers

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;" /> 
like image 118
fubo Avatar answered Sep 30 '22 10:09

fubo