Input.class vs :input.class

Benchmark created on


Preparation HTML

<form>
<ul>
<li>
<label>Foo</label>
<input type="text" class="foo">
</li>
</ul>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
input.class
$('input.foo').css('color', 'red');
ready
:input.class
$(':input.foo').css('color', 'red');
ready
just class
$('.foo').css('color', 'yellow');
ready

Revisions

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