Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
xCare Forms Selector
(version: 3)
testing .find vs context vs name selector vs context object
Comparing performance of:
Context Selector vs Find vs Name Selector vs Context Object Selector
Created:
4 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <div id="#test-root"><div name="test-child"></div></div>
Tests:
Context Selector
jQuery('[name=test-child]', '#test-root').css('border', '1px solid red');
Find
jQuery('#test-root').find('[name=test-child]').css('border', '1px solid red');
Name Selector
jQuery('[name=test-child]').css('border', '1px solid red');
Context Object Selector
jQuery('[name=test-child]', jQuery('#test-root')).css('border', '1px solid red');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Context Selector
Find
Name Selector
Context Object Selector
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
jQuery - $(selector, context) VS $(context).find(selector)
jQuery Selector
jQuery Selector #2
jQuery $(selector, context) VS $(context).find(selector) VS Vanilla querySelector
Comments
Confirm delete:
Do you really want to delete benchmark?