selector test id/id id/id class (v23)

Revision 23 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>


<div id="Mytbl">
<div id="MyElement"></div>
<div class="MyClass"></div>
<div class="MyClass2"></div>
<div class="MyClass3"></div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Direct ID
$('#MyElement');


 
ready
Nested ID's
$('#Mytbl #MyElement')
ready
ID - Class
$('#Mytbl .MyClass')
$('#Mytbl .MyClass2')
$('#Mytbl .MyClass3')
ready
ID find Class
$('#Mytbl').find('.MyClass');
$('#Mytbl').find('.MyClass2');
$('#Mytbl').find('.MyClass3');
ready
Cache ID find Class
var found = $('#Mytbl');
found.find('.MyClass');
found.find('.MyClass2');
found.find('.MyClass3');
ready
Cache ID scoped Class
var found = $('#Mytbl');
$('.MyClass', found);
$('.MyClass2', found);
$('.MyClass3', found);
ready
ID Scoped Class
$('#Mytbl > .MyClass')
$('#Mytbl > .MyClass2')
$('#Mytbl > .MyClass3')
ready

Revisions

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