Execute function every nth second
<p>Total JavaScript n00b question right here:</p>

<p>I've made this snippet that clicks a link after 10th second:</p>

<pre><code>function timeout() {
    window.setTimeout(function() {
     $('img.left').click();
    }, 1000);
    setTimeout("timeout()", 1000); 
}
timeout();
</code></pre>

<p>My question is, how do I execute this function every 10th second, instead of just once?</p>

<p>Is this the best way to do this, or is there some kind of nifty jQuery method that you prefer?</p>
