jQuery id vs class vs tag selectors (v277)

Revision 277 of this benchmark created on


Preparation HTML

<p id="foo" class="foo"></p>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
$(id)
var $foo = $('#foo');
ready
$(class)
var $foo = $('.foo');
ready
$(tag)
var $foo = $('p');
ready

Revisions

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