title: Convert [object Object] into DOM element
body: <p>I am trying to implement a slideshow in jQuery where I have all images and their description in a hidden element with the ID <code>contain</code></p>
  
  <p>Here I want to get all of the containing elements (<code>img</code> <code>span</code>) pairs so I can iterate them.
  But issue is:</p>
  
  <pre><code>var slides = $('#contain').children(); //[object Object]
  console.log(slides);
  //console.log(slides.get(0)); //&lt; this is also not working
  </code></pre>
  
  <p>This is returning <code>[object Object]</code> however I want the element as in DOM elements so I can select details, iterate them etc.</p>
  
  <p>Can any please help how can I get that?</p>
  
  <p><code>Complete code:</code></p>
  
  <pre><code>function startSlideShow(interval) {
  var slides = $('#contain').children();
  console.log("0: " + slides);
  for (var i = 0; i &lt; slides.length; i++) {
      setTimeout(
          function () {
              var slide = $(slides[i]).children();
              $('#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="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>Problem with this is it is throwing me errors like:
  <code>Uncaught TypeError: Cannot read property 'src' of undefined</code></p>