Test (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

<div id="formEdit">
  <input id="CheckBox1" type="checkbox" name="CheckBox1" checked="checked" /><label for="CheckBox1">1</label>
<input id="CheckBox2" type="checkbox" name="CheckBox2" checked="checked" /><label for="CheckBox2">2</label>
<input id="CheckBox3" type="checkbox" name="CheckBox3" checked="checked" /><label for="CheckBox3">3</label>
<input id="CheckBox4" type="checkbox" name="CheckBox4" /><label for="CheckBox4">4</label>
<input id="CheckBox5" type="checkbox" name="CheckBox5" /><label for="CheckBox5">5</label>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Case 1
alert($("input:checkbox:checked").length);
ready
Case 2
var vLength = $("input:checkbox").filter(function() {
 return $(this).is(":checked");
}).length;
alert(vLength);
ready
Case 3
alert($("input:checkbox").find(":checked").length);
ready

Revisions

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