jquery css() versus simple javascript style change (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<div id="bP4" style="left:10px; top:10px;"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
css()
obj = document.getElementById('bP4');
obj.style.top = '20px';
obj.style.left = '40px';
ready
ordinary js
obj = document.getElementById('bP4');
obj.style.height = "20px";
obj.style.lineHeight = "40px";
ready

Revisions

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