using a loop to change an image in javascript?
<p>hi im fairly new at javascript and i got an error in my script yet i cant find the bug what im trying to do is put all my images in an array then loop the array using a forloop just iike in java.Then set and interval to change the source of the image using iteration.</p>

<pre><code>$(document).ready(function(){
    $(function(){

        SetInterval(function(){

            var images = ["graphic1.jpg" , "graphic2.jpg" , "graphic3.jpg" , "graphic4.jpg" , "graphic5.jpg"];

            for(i=0;i&lt;images.length;i++){
                $("#slide").attr("src", images[i]);
            } 
        } , 1000);
    });
});
</code></pre>