Am trying to trigger an upload box (browse button) using jQuery.
The method I have tried now is:
$(\'#fileinput\').trigger(\'click\');
Based on Guillaume Bodi's answer I did this:
$('.fileinputbar-button').on('click', function() {
$('article.project_files > header, article.upload').show();
$('article.project_files > header, article.upload header').addClass('active');
$('.file_content, article.upload .content').show();
$('.fileinput-button input').focus().click();
$('.fileinput-button').hide();
});
which means it's hidden to start with and then displayed for the trigger, then hidden again immediately.