getElementById VS jQuery('#id') (v203)

Revision 203 of this benchmark created by Pontybéla on


Preparation HTML

<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<p id="foo">
  Test
</p>
<p id="bar">
  bars</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
$(document.getElementById('foo'));
ready
jQuery Selector
$('#foo');
ready
jquery2
$('[id="foo"]');
ready

Revisions

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