jquery css Height vs method Height

Benchmark created on


Preparation HTML

<!doctype html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>
      無題ドキュメント
    </title>
  </head>
  
  <body>
    <div id="test">
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
    </script>
  </body>

</html>

Test runner

Ready to run.

Testing in
TestOps/sec
css method _01
$(function() {
  var test = $("#test");
  test.css("height", 500);
})
ready
css method _02
$(function() {
  var test = $("#test");
  test.css({
    height: 500
  });
})
ready
height method
$(function() {
  var test = $("#test");
  test.height(500);
})
ready

Revisions

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