jQuery scrollTop() vs dom scrollTop (v12)

Revision 12 of this benchmark created on


Preparation HTML

<div id="container" style="height: 500px; overflow: auto">
  <div id="scrollme" style="height: 2000px;"></div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var container = $("#container");

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
container.scrollTop();
ready
jQuery + dom method
container[0].scrollTop;
 
ready
DOM Only
 
ready

Revisions

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