title: jquery convert html to string and to html
body: <p>I have the following html:</p>
  
  <pre><code>&lt;body&gt;
   &lt;div&gt;
      &lt;img id ="img1" src="http://aboveandbeyondkm.com/wp-content/uploads/2013/11/Angry-Birds-HD-Wallpaper.png" style="width:100px; height:100px;"/&gt;
   &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>and the following javascript:</p>
  
  <pre><code>var array1 = [];
  array1[0] = $('#img1');
  
  var ndiv = "&lt;div style='border: 2px solid red;'&gt;" + array1[0] + "&lt;/div&gt;";
  $('body').append(ndiv);
  </code></pre>
  
  <p>This is a waterdown version of what I'm trying to achieve but that's the basis of what I'm having difficulties with.</p>
  
  <p>When I append ndiv it doesn't append the image because it's an object. I tried jquery text(), html() and parseHTML methods with no luck. </p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>I made a jsfiddle:</p>
  
  <p><a href="http://jsfiddle.net/VttM4/1/" rel="nofollow">jsfiddle example</a></p>
  
  <p>Thanks</p>
  
  <p><strong>Update</strong></p>
  
  <p>I wanted to thank everyone for their prompt reply. Guffa answered the question correctly based on what I provided. But my code wasn't as simple as I presented it. Eman Z answer was the easiest to incorporate into the flow of my code. Wish I could choose two answers.</p>
  
  <p>Here's an example of what I'm doing. Just to give a background. There's a forum that has something called topics. Each topic have a title, comments. views and thumbnails. Each topic can have several thumbnails. In order to see the thumbnails to get a preview of the topic one would have to do click on a button. So I wanted the thumbnails to show up automatically without clicking. So what I did was create a bookmarklet which has an iframe which loads the page that the thumbnails are in. I save all this info to an array. So the example you see in the jsfiddle may seem like I'm taking images and putting it into another array but I didn't want to write all the code to get the images so I chose to show it this way for simplicity.</p>
  
  <p><a href="http://jsfiddle.net/VttM4/5/" rel="nofollow">jsfiddle solution</a></p>