I'm adding a element to a page so that multiple items on a list are clicked. I've done some jQueries to catch all the elements that I want to download, but I can't click on them with a loop. When I do a loop to click them all, only the first one is clicked.
This code makes a list, set the element target to a new window, then clicks on it. Should be a few elements on the list, so a click can be send to multiple entries.
function ClickThemAll() {
.
.
.
for (var i = 0; i < len; i++) {
var element = list.pop();
element.target="_blank";
element.click();
}
.
.
.
}
The problem is that a click is sent to the first element only, and I want it to send to all elements. I tried using setTimeout(), but it just sent multiples clicks to the same element. I need help to click them all, even with a small delay from clicks is okay.
P.S.: The list
in the code would be an array of the elements. Forgot to add it.