title: I dont know why my setInterval is not working javascript
body: <p>I have a quick question. Can anyone tell me why this code is not working? It is supposed to rotate 3 images in a banner on a website, but it only does it once. Thank you</p>
  
  <pre><code>    &lt;body onload ="setInterval(changeImage, 3000 );"&gt;
  
        &lt;script&gt;
       var cont = 1;
  
      function changeImage(){
  
  
      switch (cont)
      {
        case 1:
        document.getElementById("grandImage").src = "Images/Banner/jirafa.jpg";
        cont += 1;
        break; 
        case 2:
        document.getElementById("grandImage").src = "Images/Banner/leo.jpg";
        cont += 1;
        break; 
  
        default:
          document.getElementById("grandImage").src = "Images/Banner/lion.jpg";
          cont=0;
  
      }
  
  
  
      &lt;/script&gt;
  
  
      }
  </code></pre>