jquery append element test

Benchmark created by Hidde-Jan on


Description

Testing wether appending a jQuery object to another jQuery objects yields a performance penalty vs adding a DOM element ($elem[0]).

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Append a jQuery object
parent.append(elem);
ready
Append a DOM element
parent.append(elem[0]);
ready

Revisions

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