jquery 1.10.2 selectors (v48)

Revision 48 of this benchmark created on


Preparation HTML

<div id="test"> 
        <div class="testlink">
                <a href="#" id="linkone" title="test">test link</a>
        </div> 
        <div class="testmenu">
                <ul>
                        <li class="menuitem itemone">
                                <a href="#" title="item 1">menu item 1</a>
                        </li>
                        <li class="menuitem itemtwo">
                                <a href="#" title="item 2">menu item 2</a>
                        </li>
                        <li class="menuitem itemthree">
                                not clickable item 3
                        </li>
                </ul>
        </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script> var $jq102 = jQuery.noConflict( true ); </script>

Test runner

Ready to run.

Testing in
TestOps/sec
by id
$jq102('#linkone');
ready
by class
$jq102('.menuitem');
ready
by tag-class
$jq102('li.menuitem');
ready
by attr
$jq102('a[title="test"]');
ready
with regex
$jq102('a[title*="item"]')
ready
nth-child(even)
$jq102('li:nth-child(even)');
ready
li:last-child
$jq102('li:last-child');
ready
unquoted attr with simpler regex
$jq102('div[class^=test]');
ready
unquoted attr check
$jq102('div[title=test]');
ready

Revisions

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