using setinterval for image slideshow
<p>I am a beginer to javascript.I am trying to create a simple image slideshow using javascript.But it doesnt work.I dont know why.Please help me out.Thanks</p>

<pre><code>&lt;script&gt;
var image=document.getElementById("aaa");
var img_array=["images/Chrysanthemum.jpg","images/desert.jpg","images/koala.jpg","images/penguins.jpg","images/hydrangeas.jpg","images/lighthouse.jpg","images/jellyfish.jpg"];
var index=0;
function slide()
{
    image.setAttribute("src",img_array[index]);
    index++;
    if(index&gt;=img_array.length)
    {
    index=0;
    }
}
setInterval("slide()",2000);
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;img id="aaa" src="images/tulips.jpg" width="400" height="400" name="image" /&gt;
&lt;/body&gt;
</code></pre>
