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

Revision 29 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.aspnetcdn.com/ajax/jQuery/jquery-1.6.js"></script>
<input type="checkbox" value="y" name="my-test-checkbox" id="my-test-checkbox" checked>

Test runner

Ready to run.

Testing in
TestOps/sec
.prop()
$('#my-test-checkbox').prop('checked');
ready
.is(':checked')
$('#my-test-checkbox').is(':checked');
ready
checkbox:checked
$('#my-test-checkbox:checked');
ready
check
$('#my-test-checkbox')[0].checked
ready

Revisions

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