setting css-styles (v3)

Revision 3 of this benchmark created by Tobias on


Preparation HTML

<div id="test">test</div>
<script>
  var elStyle = document.getElementById('test').style;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
cssText
elStyle.cssText = 'background:red;'
ready
cssText adding unknown properties
elStyle.cssText = 'background:red; -moz-foo:baa;'
ready
style.property
elStyle['background'] = 'red'
ready
style.property adding unknown properties
elStyle['background'] = 'red';
elStyle['-moz-foo'] = 'baa'
ready

Revisions

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

  • Revision 1: published by Tobias on
  • Revision 2: published by Mircea Piturca on
  • Revision 3: published by Tobias on