show vs css('display','block') (v2)

Revision 2 of this benchmark created by François LASSERRE on


Preparation HTML

<div id="box">
  <div>D1</div>
  <div>D1
    <span>S2</span>
    <div>D2</div>
  </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style>#box {display:none}</style>

Test runner

Ready to run.

Testing in
TestOps/sec
jquery
$('#box').show();
ready
jquery
$('#box').css('display', 'block');
ready
jquery
$('#box').show();
ready
jquery
$('#box').css('display', 'block');
ready
jquery
$('#box').show();
ready
jquery
$('#box').css('display', 'block');
ready

Revisions

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

  • Revision 2: published by François LASSERRE on