foo (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<style>
.style1 {
    background-color: #000;
}
</style>
<div class="box" id="a1">
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
css
$('#a1').css({
  'background-color': '#000'
})
ready
addclass
$('#a1').addClass("style1")
ready
style
$('#a1').get(0).style.backgroundColor = '#000'
ready
className
$('#a1').get(0).className = 'box style1'
ready

Revisions

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