1
HTML
<div class="send">click<input name="files[]" class="file" type="file"></div>
Javascript:
$('body').on('click', '.send', function(e) {
$(document).find('.file').click();
});
CSS:
input {
opacity: 0;
}
When clicking on "click" the error is returned, as it detects click on the parent div and daughter provoking a loop, how to solve? I look forward to just opening the input file.
I didn’t know that one from
label
tested in my script but it didn’t work, must be because it is an icon made with the:before
. Thanks for the solution!!– Elaine