title: jquery: fastest DOM insertion?
body: <p>I got this bad feeling about how I insert larger amounts of HTML.
  Lets assume we got:</p>
  
  <p><code>var html="&lt;table&gt;..&lt;a-lot-of-other-tags /&gt;..&lt;/table&gt;"</code></p>
  
  <p>and I want to put this into</p>
  
  <p><code>$("#mydiv")</code></p>
  
  <p>previously I did something like</p>
  
  <p><code>var html_obj = $(html);</code>
  <code>$("#mydiv").append(html_obj);</code></p>
  
  <p>Is it correct that jQuery is parsing <code>html</code> to create DOM-Objects ?  Well this is what I read somewhere <strong>(UPDATE:</strong> I meant that I have read, jQuery parses the html to create the whole DOM tree by hand - its nonsense right?!<strong>)</strong>,  so I changed my code:</p>
  
  <p><code>$("#mydiv").attr("innerHTML", $("#mydiv").attr("innerHTML") + html);</code></p>
  
  <p>Feels faster, is it ? And is it correct that this is equivalent to:</p>
  
  <p><code>document.getElementById("mydiv").innerHTML += html</code> ? or is jquery doing some additional expensive stuff in the background ?</p>
  
  <p>Would love to learn alternatives as well.</p>