jquery input:checked vs :radio:checked

Benchmark created by wanghq on


Preparation HTML

<input type="radio">
<input type="checkbox">
<input type="text">
<input name="what" type="radio" check="checked">
<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
input:checked
$('input[name="what"][type="radio"]:checked')
ready
:radio:checked
$(':radio[name="what"]:checked')
ready

Revisions

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

  • Revision 1: published by wanghq on