jQuery text() vs. html() (v16)

Revision 16 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="text">Test text</div>
<script>
  var $text = $("#text");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
append()
$text.append("<span />")
ready
html()
$text.html("<span />")
ready

Revisions

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