Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS / jQuery selector variables
(version: 5)
Comparing performance of:
#A vs #B vs #C vs #D vs #E vs #F
Created:
9 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
Script Preparation code:
$body = $('body'); bodyEl = document.body; var app = {}; app.getBody = function() { return $body; } app.getBody2 = function() { return $('body'); }
Tests:
#A
$body
#B
$('body')
#C
bodyEl
#D
document.body
#E
app.getBody
#F
app.getBody2
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
#A
#B
#C
#D
#E
#F
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 by id vs Document.getElementById
test1123
test1114
querySelector vs querySelector + cache
querySelector vs querySelector + cache using Map2
Comments
Confirm delete:
Do you really want to delete benchmark?