title: Uncaught TypeError: Cannot read property 'src' of undefined
body: <p>I am trying to implement a slide show, I have written following code but it’s not working most probably due to the reason that this line <code>$('#contain').children();</code> is returning <code>[object Object]</code> instead of a DOM elements over which I can iterate?</p>
  
  <p><code>Complete code:</code></p>
  
  <pre><code>function startSlideShow(interval) {
  //var slides = $('#contain').children();
  var slides = $('#contain').children().get();
  console.log("0: " + slides);
  slides.each(function () {
      console.log($(this));
  });
  for (var i = 0; i &lt; slides.length; i++) {
      setTimeout(
          function () {
              var slide = $(slides[i]).children();
              console.log("1: " + slide);
              $('#currentImage').attr('src', slide[0].src).fadeIn(interval * 100);
              $('#slideDesc').html(slide[1].innerHTML).fadeIn(interval * 100);
          }, interval * 1000);
  }
  }
  </code></pre>
  
  <p><code>in the html:</code></p>
  
  <pre><code>&lt;article id="imageShow"&gt;
      &lt;div class="image"&gt;
          &lt;img src="" id="currentImage" /&gt;
      &lt;/div&gt;
      &lt;div id="imageCover"&gt;&lt;/div&gt;
  &lt;/article&gt;
  
  &lt;article id="contain"&gt;
      &lt;div class="image"&gt;
          &lt;img src="http://i.imgur.com/925p6M5.jpg" /&gt;
          &lt;span&gt;1Lorem Ipsum is simply dummy text of the printing and typesetting industry. &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="image"&gt;
          &lt;img src="http://i.imgur.com/dbBu5rk.jpg" /&gt;
          &lt;span&gt;2 Lorem Ipsum is simply dummy text of the printing and typesetting industry. &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="image"&gt;
          &lt;img src="http://i.imgur.com/VFxPGEi.gif" /&gt;
          &lt;span&gt;3 Lorem Ipsum is simply dummy text of the printing and typesetting industry. &lt;/span&gt;
      &lt;/div&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p>and in console i get errors like: 'Uncaught TypeError: Cannot read property 'src' of undefined'</p>