jquery.html vs innerHTML (v19)

Revision 19 of this benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>
<button id="btn">hallo</button>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.html()
for (var i = 0; i < 1000; i++) {
  $("#btn")[0].innerHTML = "test";
}
ready
innerHTML
for (var i = 0; i < 1000; i++) {
  document.getElementById("btn").innerHTML = "test";
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.