show vs addclass (v6)

Revision 6 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.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
.css()
$(elem).css('display','block');
ready

Revisions

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