I would like to know how to trigger click event on all download buttons in jquery.
I am using WebShare from Share it and i would like to download a folder at a time because it contains many files and I can't go on downloading each file.
I tried using Downthemall but they are buttons and not links. When they are clicked the Download gets started.
Anyway, all the download buttons have the class button-download
and I tried the following
var reversed = $("button.button-download").get().reverse();
$(reversed).each(function () {
$(this).trigger("click").delay(100);
});
But that downloads only the first file. I have tried delay() so that for every download, there will be a delay so that Firefox won't get stuck. But still, it downloads only the first one and leaves the rest (i.e. doesn't click on the rest of the buttons)
I am executing the script in Inspector console of firefox.
P.S. I have looked at available answers at Stackoverflow but they didn't seem to work for me.