jquery selector speed (v36)

Revision 36 of this benchmark created on


Preparation HTML

<div id="container">
    <ul>
        <li>1</li>
        <li class="target" type="target">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
Tag Att
$('li[type="target"]').css('border','1px solid red');
ready
Att
$('[type="target"]').css('border','1px solid red');
ready
Tag Class
$('li.target').css('border','1px solid red');
ready
Class
$('.target').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.