Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remove the "No file chosen" tooltip from a file input in Chrome?

I would like to remove the "No file chosen" tooltip from a file input in Google Chrome (I see that no tooltip is displayed in Firefox).

Please notice that I'm talking not about the text inside the input field, but about the tooltip that appears when you move the mouse over the input.

I've tried this with no luck:

$('#myFileInput').attr('title', ''); 
like image 472
German Latorre Avatar asked Aug 20 '12 09:08

German Latorre


People also ask

How do I delete a file input?

One way to remove a file from a JavaScript FileList is to use the spread operator to convert the FileList to an array. Then we can call splice to remove the file we want. We add multiple to let select multiple files. We get the file input element with getElementById .


2 Answers

The default tooltip can be edited by using the title attribute

<input type='file' title="your text" /> 

But if you try to remove this tooltip

<input type='file' title=""/> 

This won't work. Here is my little trick to work this, try title with a space. It will work.:)

<input type='file' title=" "/> 
like image 102
simon Avatar answered Sep 20 '22 23:09

simon


For me, I just wanted the text to be invisible and still use the native browser button.

input[type='file'] {   color: transparent; } 

I like all of undefined's suggestions but I had a different use case, hope this helps someone in the same situation.

like image 39
Dwayne Forde Avatar answered Sep 20 '22 23:09

Dwayne Forde