Class manipulation native

Benchmark created by Arexkun on


Preparation HTML

<div id="test" class="test tra">Asdf</div>
<script>
  var d=document.getElementById("test"),
  cli=d.classList,
  cna=d.className;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
native
cli.contains("test")
ready
other
/\s?test\s?/.test(cna);
ready

Revisions

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