jQuery Selection via Class or Element & Class

Benchmark created by Kevin Parkerson on


Preparation HTML

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

<div></div>
<div></div>
<span></span>
<ul>
    <li></li>
    <li></li>
</ul>
<span></span>
<h1>djkfjalkf</h1>
<div></div>
<input type="text" class="find"/>
<div></div>
<div></div>
<span></span>
<table><tr><td></td></tr></table>
<div></div>

Test runner

Ready to run.

Testing in
TestOps/sec
Selection by Class
var a = $('.find');
console.log(a);
ready
Selection by Element + Class
var b = $('input.find');
console.log(b);
ready

Revisions

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

  • Revision 1: published by Kevin Parkerson on