jquery attr() vs standard js setAttribute() (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<input type="text" id="btn"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery attr()
$("#btn").attr("disabled", "disabled");
ready
js setAttribute()
document.getElementById('btn').setAttribute("OnKeyPress", "alert(12);");
ready

Revisions

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