# vs. document.getElementById (v2)

Revision 2 of this benchmark created by bigbossSNK on


Preparation HTML

<div id='div'></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
$(#)
$('#div');
ready
$(getElementById)
$(document.getElementById('div'));
ready
getElementById
document.getElementById('div')
ready

Revisions

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

  • Revision 1: published by ethagnawl on
  • Revision 2: published by bigbossSNK on