ClassList versus ClassName (v10)

Revision 10 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>

Test runner

Ready to run.

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

ready

Revisions

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