Inline style vs CSS class (v14)

Revision 14 of this benchmark created by carl sverre on


Preparation HTML

<style rel='stylesheet'>
  .test { color: #f66; background-color: #033; }
  .test.foo { font-size: 13px; }
</style>

Setup

var node = document.createElement('div');

Teardown



            document.body.removeChild(node);
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
Inline style color
node.style.color = '#f66';
document.body.appendChild(node);
ready
CSS class
node.className = 'test foo';
document.body.appendChild(node);
ready
inline style object
node.style = {color: '#f66', "background-color: '#033', "font-size": "13px"};
document.body.appendChild(node);
ready

Revisions

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