jQ empty() vs html('')

Benchmark created by Okke on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="photoviewer">
<div class="slides_container">
<div class="slide"><img src="http://placehold.it/630x414" alt="" /></div>
</div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
empty()
$('#photoviewer .slides_container').empty();
ready
html('')
$('#photoviewer .slides_container').html('');
ready

Revisions

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