Skip to content

Instantly share code, notes, and snippets.

@manuelcanga
Created January 7, 2022 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelcanga/626ba4f756d05b31db6e58c0e16b1d1c to your computer and use it in GitHub Desktop.
Save manuelcanga/626ba4f756d05b31db6e58c0e16b1d1c to your computer and use it in GitHub Desktop.
Eliminar el label de "aún no se ha seleccionado ningún archivo"
<div>
<input type='file'/>
<span id='val'></span>
<span id='button'>Select File</span>
</div>
input[type='file'] {
color: transparent;
}
opción 3
default tooltip can be edited by using title attribute
<input type='file' title="your text" />
But if you try to remove this tooltip
<input type='file' title=""/>
This wont work. Here is my little trick to work this, try title with a space. It will work.:)
<input type='file' title=" "/>
$('#button').click(function(){
$("input[type='file']").trigger('click');
})
$("input[type='file']").change(function(){
$('#val').text(this.value.replace(/C:\\fakepath\\/i, ''))
})
input[type='file'] {
opacity:0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment