Wayne Gregori Wayne Gregori - 9 months ago 61
Javascript Question

javascript to click a link every 5 seconds

I need a javascript routine that will click a link every n seconds until interrupted. I did find a routine that clicked a button but I don't know how to point the function to a link rather than a .button.


Answer Source

Assuming you're actually trying to click a link that doesn't navigate to another page (what you asked, I suppose), you would probably use jQuery:

var variableToCancelInterval = setInterval(function(){
}, 5000);