document.getElementById VS Jquery $('#') (v26)

Revision 26 of this benchmark created on


Description

Comparison for $('#idSelector') VS document.getElementById('');

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<p class"foo">
  Test
</p>

Test runner

Ready to run.

Testing in
TestOps/sec
test1
document.getElementsByClassName('foo');
ready
Test2
$('.foo');
ready
Test3
 
ready

Revisions

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