jQuery scrollTop() vs dom scrollTop (v3)

Revision 3 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

$("#container").scrollTop(500);

Test runner

Ready to run.

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

Revisions

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