.css("display", "none") vs g.hide() (v9)

Revision 9 of this benchmark created on


Preparation HTML

<script src="http://code.jquery.com/jquery-1.5.1.min.js"></script>

<div id="myDiv" style="border:1px solid black;width:10px;height:10px;padding:10px;">Wow</div>

Setup

var myDiv = document.getElementById('myDiv');
  var $myDiv = $(myDiv);

Teardown



            $myDiv.css("display", "block");
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
.css("display", "none")
$myDiv.css("display", "none");
ready
hide()
$myDiv.hide();
ready

Revisions

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