style.backgroundColor versus jquery css (v29)

Revision 29 of this benchmark created on


Description

document.body.style.backgroundColor vs jQuery CSS

Preparation HTML

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

Test runner

Ready to run.

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

Revisions

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