clone() vs html()

JavaScript performance comparison

Test case created

Info

Compare functions jQuery html() and clone()

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="block_A">
<h2>Title block A</h2>
</div>
<div id="block_B">
</div>

Preparation code output

Title block A

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Clone()
$('#block_B').html($('#block_A h2').clone());
pending…
Html()
$('#block_B').html($('#block_A').html());
pending…

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

Compare results of other browsers

0 comments

Add a comment