Created
January 7, 2022 19:17
-
-
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"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<input type='file'/> | |
<span id='val'></span> | |
<span id='button'>Select File</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[type='file'] { | |
color: transparent; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=" "/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#button').click(function(){ | |
$("input[type='file']").trigger('click'); | |
}) | |
$("input[type='file']").change(function(){ | |
$('#val').text(this.value.replace(/C:\\fakepath\\/i, '')) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[type='file'] { | |
opacity:0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment