getElementById vs. querySelector (v132)

Revision 132 of this benchmark created by dubai on


Preparation HTML

<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<p id="foo">Foo</p>
<p id="bar">Bar</p>
<p id="baz">Baz</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
var bar = document.getElementById("bar");
ready
jQuery
var bar = $("#bar");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.