jquery selector speed (v111)

Revision 111 of this benchmark created on


Preparation HTML

<div id="icont" class="ccont">
    <ul>
        <li class="target">1</li>
        <li>2</li>
        <li>3</li>
    </ul>
</div><script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
1
$('#icont .target').eq(0).css('border','1px solid red');
ready
2
$('.ccont .target').eq(0).css('border','1px solid red');
ready
3
$('#icont li').eq(0).css('border','1px solid red');
ready
4
$('.ccont li').eq(0).css('border','1px solid red');
ready

Revisions

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