Inline style vs CSS class (v6)

Revision 6 of this benchmark created on


Preparation HTML

<style rel='stylesheet'>
  .test { color:#fff;float:left;width:100px;height:100px; }
</style>

Setup

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

Teardown



            document.body.removeChild(node);
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
Inline style
node.setAttribute('style', 'color:#fff;float:left;width:100px;height:100px;');
document.body.appendChild(node);
ready
CSS class
node.className = 'test';
document.body.appendChild(node);
ready

Revisions

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