I want to change the default value of <input type="file" />
from “Choose file” to “Browse”. How to do that?
You can simply use ::-webkit-file-upload-button in css and style your Choose file button.
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.
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.
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;" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With