Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
jQuery by id vs Document.getElementById
Comparing speed of getting element by id with jQuery vs Vanilla JS
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Vanilla JS
35.9M/s
jQuery
5.7M/s
View exact numbers
Test name
Executions per second
✓
Vanilla JS
35,937,840 Ops/sec
jQuery
5,732,447 Ops/sec
HTML Preparation code:
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.0.min.js"></script> <div id="testElement"></div>
Tests:
jQuery
var el = $("#testElement")[0]; var className = el.className;
Vanilla JS
var el = document.getElementById('testElement'); var className = el.className;