Here is my html code
<input type="button" id="btn" value="UPLOAD" />
<input id="fileupload" type="file" style="display:none;" />
here is jquery code
$('#btn').click(function () {
$('#fileupload').click();
});
It works as expected in Chrome and in windows safari doesn't do any thing.And i checked no error in console. Here is a jsfiddle
try hiding input file using the below code instead of display:none;
opacity:0;width:0px;height:0px;
You can also do:
input[type="file"] {
visibility: hidden;
position: absolute;
}
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