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

Revision 30 of this benchmark created by Jason on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
jQuery.noConflict();
</script>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js"></script>
<p id="foo">
  Test
</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
var a = document.getElementById('foo');
 
ready
jQuery
var a = jQuery('#foo');
ready
Prototype
var a = $("foo");
ready

Revisions

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