jQuery prop('checked') vs. is(':checked') (v96)

Revision 96 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://code.jquery.com/jquery-2.2.0.min.js"></script>

<input type="checkbox" value="y" name="my-test-checkbox" id="my-test-checkbox" checked>
<script>
  var $el = $('#my-test-checkbox');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.prop()
$el.prop('checked');
ready
.is(':checked')
$el.is(':checked');
ready
.checked
$el[0].checked;
ready

Revisions

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