jquery selector speed (v22)

Revision 22 of this benchmark created by SkeLLLa on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
$('#container')
$('#container').css('border','1px solid red');
ready
$('.container')
$('.container').css('border','1px solid red');
ready
$('div#container')
$('div#container').css('border','1px solid red');
ready
$('div.container')
$('div.container').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.