title: jQuery html() acting really slow
body: <p>I was testing something I read earlier about how random <code>Math.random()</code> really is, and wanted to display 10000 numbers that was supposed to be a random number between 0 and 10000000.</p>
  
  <p>To see the test, I chose to just join the array of random numbers to a string with <code>&lt;br&gt;</code> between each integer. And then I just did <code>$("#"+elm).html(randomNumberString);</code> which was really slow. I just figured it was the generation and sorting of random numbers into an array. But as I started placing timers in my code, it got appearant that it was the output that was slowing everything down.</p>
  
  <p>Just as a test I did <code>document.getElementById(elm).innerHTML = randomNumberString;</code></p>
  
  <p>jQuery.html(): 2500ms
  getElementById.innerHTML: 170ms</p>
  
  <p>I tried this across all 5 browsers, and the numbers were very close in all browsers... Am I using jQuery wrong in this instance? I also tried append and fetching the element before the timer started, so I could simply do <code>$(elm).html()</code>, but that didn't help. It seems to be the actual <code>html()</code> function that's slowing everything down..?</p>
  
  <p><strong>EDIT</strong> I ended up doing this:</p>
  
  <pre><code>randomStringNumber = "&lt;div&gt;" + randomStringNumber + "&lt;/div&gt;";
  </code></pre>
  
  <p>and now the whole thing runs a lot faster:
  jQuery.html(): 120ms
  getElementById.innerHTML: 80ms</p>
  
  <p>Still faster using oldschool html, though. And if anyone has an answer to why wrapping it in one element is faster, I'd appreciate that...</p>