Change Attribute Every Second
<p>I want an image to change every second. I'm having trouble with setInterval. Could someone post a quick snippet on how to do this</p>

<p>This is what I came up with.</p>

<pre><code>var images = 'images/image_*.png';
for(var i = 1; i &lt;= 5; i++){
    function changeImg(){
     var path = images.replace('*', i);
     $('img').attr('src', path);
    }
    setInterval('changeImg()', 1000);
}
</code></pre>
