JQuery plugin to change input file element's text. It's also light - 3KB un-minified.
-
Download this plugin from
src/jquery-input-file-text.js
. -
Add this script after JQuery.
<script src='jquery-input-file-text.js'></script>
-
Create an input file element.
<input type="file" id="choose-file" />
-
Apply this plugin on the input file element.
$(document).ready(function() { $('#choose-file').inputFileText( { text: 'Select File' } ); });
Result
-
To remove this plugin:
$('#choose-file').inputFileText( { remove: true } );
The following options can be specified when applying this plugin to the input file element:
$('#choose-file').inputFileText({
text: 'Select File', // The button will display this text
buttonCLass: 'buttonClassName', // The button's class
textClass: 'textClassName' // The text's class
});