Browser Diet - jQuery Selectors (v3)

Revision 3 of this benchmark created on


Preparation HTML

<div>
  <ul class="unorderedlist" id="list">
    <li class="test" id="testl">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
    <li>
    </li>
    <li class="test">
    </li>
  </ul>
</div>
<div class="test">
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
  var list = document.getElementById('list');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Class Selector
var $test = $('.unorderedlist');
ready
ID Selector
var $test = $('#list');
ready
context and find()
var $test = $('#list').find('#testl');
ready
created context
var $test = $('.test', $('#list'));
ready
selector and find
var $test = $('#list').find('.test');
ready
parent/child selector
var $test = $('#list > .test');
ready
immediate children
$test = $(list).children('.test');
ready

Revisions

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