Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
jQuery vs Vanilla JS GetID Speed Test3
(version: 0)
Comparing speed of getting element by id with jQuery vs Vanilla JS
Comparing performance of:
jQuery(#id) vs jQuery(.id) vs jQuery(tag.id)
Created:
6 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="//code.jquery.com/jquery-3.4.0.slim.min.js"></script> <div id="#basket-content"> <ul class="nav nav-tabs"> <li> <a href="#content-prints" data-toggle="tab" class="font-16"> <i class="fa fa-file-photo-o m-r-10"></i> </a> </li> </ul> </div>
Tests:
jQuery(#id)
var el = $("#basket-content ul.nav li"); var className = el.className;
jQuery(.id)
var el = $("#basket-content .nav li"); var className = el.className;
jQuery(tag.id)
var el = $("#basket-content ul li"); var className = el.className;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
jQuery(#id)
jQuery(.id)
jQuery(tag.id)
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
jQuery 3.3.1 slim by id vs Document.getElementById
jQuery versus Vanilla JS GetID Speed Test
jQuery vs getElementById vs querySelector vs $(getElementById) jquery 3.6.3
Comments
Confirm delete:
Do you really want to delete benchmark?