title: Display images from an array
body: <p>I am trying to display six images from a javascript array. Running the code below I get no results it simply seems to be not working. I have no idea where my fault is. </p>
  
  <p><strong>Here is the javascript code:</strong></p>
  
  <pre><code>var backgroundImage = new Array(); 
  backgroundImage[0] = "images/colors-wallpaper.jpg";
  backgroundImage[1] = "images/florida-birds.jpg";
  backgroundImage[2] = "images/focus-on-life.jpg";
  backgroundImage[3] = "images/set-into-life.jpg";
  backgroundImage[4] = "images/dandelion.jpg";
  backgroundImage[5] = "images/flowers.jpg";
  backgroundImage[5] = "images/flowers.jpg";
  
  function displayAllImages() {
  // Here has to be some error!!! //
   for (i=0;i&lt;backgroundImage.length;i++) {
      document.write("&lt;li&gt;&lt;img src='" + backgroundImage[i] + "' width="160" height="120"/&gt;&lt;span&gt;" + backgroundImage[i] + "&lt;/span&gt;&lt;/li&gt;");
  }
  }
  </code></pre>
  
  <p><strong>And that's my html code:</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javaScript" src="changebackground.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="container"&gt;
  
      &lt;div class="backgoundImage"&gt;
      &lt;ul&gt;
          &lt;script&gt;displayAllImages();&lt;/script&gt;
      &lt;/ul&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>