title: jQuery.contents() get each element as HTML / STRING
body: <p>I'm trying to get the HTML form of some objects(including text), using jquery contents. Here's what I got until now:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="mydiv"&gt;
      test
      &lt;p&gt;foo&lt;/p&gt;
      &lt;p&gt;bar&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code>$('#mydiv').contents().each(function(){
      console.log($(this).html());
      console.log($(this).prop("innerHTML"));
      console.log($(this).prop("outerHTML"));
  });
  </code></pre>
  
  <p>Is there any way to do this? I've searched around but I couldn't find anything.</p>
  
  <p>Thank you in advance for the answer!</p>