Test performance of jQuery .attr() vs. .prop() (v4)

Revision 4 of this benchmark created on


Preparation HTML

<input id="testinput" type="text" name="testme" value="1" />

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

Test runner

Ready to run.

Testing in
TestOps/sec
.attr()
$('#testinput').attr('disabled', 'disabled');
$('#testinput').removeAttr('disabled');
ready
.prop()
$('#testinput').prop('disabled', true);
$('#testinput').prop('disabled', false);
ready

Revisions

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