wrapall except img 2

JavaScript performance comparison

Test case created on 22nd January 2013

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div class="single-post">
    <img class="exclude" src="" />
    <p></p>
    <p></p>
    <blockquote></blockquote>
    <p></p>
</div>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
siblings
$('.single-post > img').siblings().wrapAll('<div class="new" />');
pending…
exclude
$('.single-post').children(':not(.exclude)').wrapAll('<div class="new" />');
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

Add test · Latest · Popular · FAQ · Donate · twitter: @jsperf · source on GitHub · Benchmark.js · by @mathias and contributors