The same can be done using .scrollTop
, .scrollHeight
present in JavaScript.
They are use to get scrolled position for a particular element.
Usage -
var myElement = document.getElementById('my-element'); // Container which has scrollable vertical contents
myElement.scrollTop; // Gives scrolled poins from top
myElement.scrollHeight; // Gives maximum scrollable vertical space
myElement.scrollTop = myElement.scrollHeight; // Setting the top scroll value to maximum allowed value
For animated scrolling -
$('body,html').animate({ scrollTop: 0}, 800);