selector test id/id id/id class (v26)

Revision 26 of this benchmark created by Joseph Presley on


Description

Rev 26 Notes: Added Test 9 to compare getElementByID without jQuery vs with jQuery wrapper.

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>

Test runner

Ready to run.

Testing in
TestOps/sec
Direct ID
$('#MyElement');
ready
Nested ID's
$('#Mytbl #MyElement')
ready
ID - Class
$('#Mytbl .MyClass')
ready
find()
$("#Mytbl").find(".MyClass");
ready
Context
$("div.MyClass", "#Mytbl");
ready
ID / Class with Tag
$('#Mytbl div.MyClass')
ready
Direct ID getElementByID w/ jQuery
$(document.getElementById("Mytbl"));
ready
getElementByID as context
$("div.MyClass", document.getElementById("Mytbl"));
ready
getElementByID without Jquery
document.getElementById("Mytbl");
ready

Revisions

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