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

Revision 170 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<p id="foo">
  Test
</p>
<script>
jQuery.fn.dom = function() {
    return this[0];
};
var obj = $("#foo");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jquery array
var test = obj[0]
ready
jQuery custom
var test = obj.dom()
ready

Revisions

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