Mehur Mehur - 2 months ago 10
HTML Question

How to change upload text language?

I am using codeigniter 3.1 .

How to change upload text language ?


<input type="file" name="file" />


I want to change
Choose File - No file chosen
default English language to other.

I tried this but not worked.

<input type="file" name="file" value="new language" />


enter image description here

Answer

Try this,

HTML:

<div>
    <input type='file'/>
    <span id='val'></span>
    <span id='button'>Select File</span>
</div>  

JAVASCRIPT

$('#button').click(function(){
   $("input[type='file']").trigger('click');
})

$("input[type='file']").change(function(){
   $('#val').text(this.value.replace(/C:\\fakepath\\/i, ''))
}) 

DEMO