Inline style vs CSS class (v22)

Revision 22 of this benchmark created by Sergey Mamyan on


Preparation HTML

<style rel='stylesheet'>
  .test { color: #f66; }
  .other {background-color:#f00}
  div {display:'inline'}
</style>

Setup

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

Teardown



            document.body.removeChild(node);
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
Inline style
node.style.color = '#f66';
node.style.backgroundColor = '#f66';
node.style.display = 'inline';
document.body.appendChild(node);
ready
CSS class
node.className = 'test other';
document.body.appendChild(node);
ready

Revisions

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