I have the following code to open windows explorer to select a file:
$('#btnCargarArchivo').click(function () {
$('#form-filtro').prop('submit', null);
$('#form-filtro').unbind();
$("#file-fichero").trigger('click');
});
It works for me in firefox, chrome but in safari it doesn't work for me.
Sometimes it is not necessary to use
JS
.The tag
label
provides the behavior it seeks to mimic:Example: