title: getElementbyId causing browser to crash
body: <p>I'm working on a project for my class that requires me to change a banner image every 5 seconds for an unspecified amount of time. I'm using setInterval to do this, but I think it's causing a problem with my function. After 30sec-1min the browser crashes.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;body onload="startImgLoop();"&gt;
      &lt;img id="banner" alt="Banner Image" /&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>function startImgLoop()
  {           
      var img = document.getElementById("banner");
      img.src = pictures[index];
  
      setInterval(startImgLoop, 5000);
  
      if (index == 5)
          index = 0;
      else index++;
  }
  </code></pre>
  
  <p>When the browser crashes it asks me if I want to stop the script and it points to the first line of the loop where I'm using getElementById. Can someone please help explain why it's doing this?</p>