addClassVsClass

Benchmark created by Leela on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div id="orderPageContainer"> </div>

Test runner

Ready to run.

Testing in
TestOps/sec
addClass
for (var i = 0; i < 1000; i++) {
 $("#orderPageContainer").addClass = "newClass";
}
ready
getById
for (var i = 0; i < 1000; i++) {
 document.getElementById('orderPageContainer').className = 'newClass';
}
ready

Revisions

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