show vs addclass (v18)

Revision 18 of this benchmark created by Vitalii on


Preparation HTML

<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
<style type="text/css">
  .displayClass { display: block; }
</style>
<div id="test" style="display: none;">Hi</div>
<script>
  var elem = document.getElementById("test");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.show()
$(elem).show();
ready
.addClass()
$(elem).addClass("displayClass");
ready

Revisions

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