ClassList versus ClassName (v11)

Revision 11 of this benchmark created on


Preparation HTML

<div id="foo"
></div>
<script>
 fooEl = document.getElementById('foo');
</script><script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

fooEl.className = 'aaaa bbbb cccc dddd';
  jFooEl = jQuery(fooEl);

Test runner

Ready to run.

Testing in
TestOps/sec
Class List
fooEl.classList.add('bbbb');    // duplicate
ready
Raw Class Name
fooEl.className += 'ffff';
ready

Revisions

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