I've tried to develop a simple Greasemonkey script in javascript. How can I automatically simulate a click on specific button with an interval between each click?
Here's my code:
var Next=document.getElementsByClassName("SubmitButton");
for (var i=0, c = Next.length; i<c; i++)
{
Next[i].click();
setTimeout('Next[i].click()',3000);
}
The problem is that the code only clicks on the first value of Next
. Why?