Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
DataAttribute vs Class Selector vs ID Selector -- complex version
(version: 0)
Comparing performance of:
Class vs ID vs data attribute
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<header>header</header> <main class="main" id="main" main> <div> <span>Title</span> <div class="hello" id="hello" hello>Hello</div> <span>World</span> </div> </main> <footer>header</footer>
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!
Comments
Confirm delete:
Do you really want to delete benchmark?