title: How to implement image slide show using javascript
body: <p>I tried implementing it.But..the image changes from the first to the secnd and then stops.</p>
  
  <p>for your reference,please find the code i tried to implemented.</p>
  
  <pre><code>&lt;div id="images"&gt; &lt;img  name="slide" src="img/banner1.png"/&gt;
  &lt;script type="text/javascript" &gt;
  var slideShow=document.getElementById("images");
  var allImages= new Array();
  allImages=["img/banner3.png","img/banner2.png","img/banner4.png","img/banner5.png"];
  var imageIndex=0;
  function changeImage()
  {
      document.images.slide.src=allImages[imageIndex];
      //slideShow.setAtrribute("src",allImages[imageIndex]);
      console.log("executing 1");
      imageIndex++;
      if(imageIndex &gt;= allImages.length)
      {
         console.log("executing 2");
         imageIndex=0;
      }
  }console.log("executing 3");
  setTimeout("changeImage()",1000);
  console.log("executing 4");
  &lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Can Someone,help me in fixing this issue..Please!</p>