style.backgroundColor versus jquery css

JavaScript performance comparison

Revision 29 of this test case created

Info

document.body.style.backgroundColor vs jQuery CSS

Preparation code

<script src="//code.jquery.com/jquery-git2.js"></script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Jquery css()
$('body').css('background-color', '#6ca5dd');
pending…
Raw ByTagName
document.getElementsByTagName('body')[0].style.backgroundColor = '#6ca5dd';
pending…
Raw style
document.body.style.backgroundColor = '#6ca5dd';
pending…
Hybrid
$('body')[0].style.backgroundColor = '#6ca5dd';
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment