css change key/value vs object

Benchmark created by Damian on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="test">
  Test
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
key/value
$('#test').css('color', '#F00');
$('#test').css('border', '1px solid #F00');
$('#test').css('background', '#F00');
$('#test').css('padding', '5px');
ready
object
$('#test').css({
  color: '#F00',
  border: '1px solid #F00',
  background: '#F00',
  padding: '5px'
});
ready

Revisions

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