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', '');
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 .
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=" "/>
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.
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