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

Revision 108 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="foo" />
<script>
window.element = null;
</script>

Teardown


    window.element = null;
  

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
window.element = document.getElementById('foo');
ready
jQuery
window.element = $('#foo')[0];
ready
jQuery with getElementById
window.element = $(document.getElementById('foo'))[0];
ready

Revisions

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