Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
DataAttribute vs Class Selector vs ID Selector (multi-class)
(version: 0)
Comparing performance of:
Class vs ID vs data attribute
Created:
6 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div class="hello" id="hello" data-hello>Hello</div> <div class="hello class2" id="hello2" data-hello data-hello2>Hello</div> <div class="hello class3" id="hello3" data-hello data-hello3>Hello</div> <div class="hello class4" id="hello4" data-hello data-hello4>Hello</div> <div class="hello class5" id="hello5" data-hello data-hello5>Hello</div> <div class="hello class6" id="hello6" data-hello data-hello6>Hello</div> <div class="hello class7" id="hello7" data-hello data-hello7>Hello</div> <div class="hello class8" id="hello8" data-hello data-hello8>Hello</div> <div class="hello class9" id="hello9" data-hello data-hello9>Hello</div> <div class="hello class10" id="hello10" data-hello data-hello10>Hello</div> <div class="hello class11" id="hello11" data-hello data-hello11>Hello</div> <div class="hello class12" id="hello12" data-hello data-hello12>Hello</div> <div class="hello class13" id="hello13" data-hello data-hello13>Hello</div> <div class="hello class14" id="hello14" data-hello data-hello14>Hello</div> <div class="hello class15" id="hello15" data-hello data-hello15>Hello</div>
Tests:
Class
document.querySelector('.hello');
ID
document.querySelector('#hello');
data attribute
document.querySelector('[data-hello]');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Class
ID
data attribute
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:
DataAttribute vs Class Selector vs ID Selector / JQuery
ID-selector vs Class-selector vs Data-attribute-selector (extended)
DataAttribute vs Class Selector vs ID Selector #1
DataAttribute vs Class Selector vs ID Selector test
Comments
Confirm delete:
Do you really want to delete benchmark?