count = 1;
$("a.btns").each(function() {
if ($(this).parent("span").attr("id") == "btn_default") {
return;
}
count++;
these = $(this);
setTimeout(function() {
$(these).click();
}, 10000 * count);
});
The problem should be very simple to solve, but to break the head ..
Basically, I try to run about 10 buttons on the page, which meet the "btns" class, and every 10 seconds (as I defined in the timeout), click the button (one at a time, code).
But in practice, only the last button is clicked every time. It seems that in any setTimeout call, the "inves of these" is each button, it takes the last of the loop each.
What to do in this case?
Thank you