jQuery: the scrollTop() method

HTML

<p><button id="scroll">scrollTop()</button></p>

<div id="test"></div>

CSS

#test {
    width: 100px;
    height: 100px;
    position: relative;
    top: 1000px;
    background: green;
}

JavaScript

$('#scroll').click(function() {
    $('html,body').animate({
        scrollTop: $('#test').css('top')
    }, 800, function() {
				setTimeout(function(){
        	$('html, body').animate({
              scrollTop: 0
          }, 800);
        }, 2000);
    });
});