jQuery :radio vs [type=radio]

Benchmark created by Dan Manastireanu on


Preparation HTML

<input type="radio">
<input type="checkbox">
<input type="text">
<input type="radio">
<input type="radio">
<input type="hidden">
<input type="text">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
:radio
$(':radio')
ready
[type=radio]
$('[type=radio]')
ready
input:radio
$('input:radio')
ready
input[type=radio]
$('input[type=radio]')
ready

Revisions

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

  • Revision 1: published by Dan Manastireanu on