jQuery checkbox check (v70)

Revision 70 of this benchmark created on


Description

A quick test to see if prop('checked') or is(':checked') is faster with jQuery.

Preparation HTML

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

<input type="checkbox" value="y" class="test-checkbox" name="my-test-checkbox1" id="my-test-checkbox1">
<input type="checkbox" value="z" class="test-checkbox" name="my-test-checkbox2" id="my-test-checkbox2">

<script>
  var $el = $('.test-checkbox');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
1
$el[0].checked = true;
ready
2
$el[0].checked = true;
ready
3
$el[0].checked = true;
ready

Revisions

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