I did a small example in jsfiddle. Hope that helps you.
Click Here[
^]
Button is just placed at the bottom irrespective of the page/document/content. Please make sure you have a floating button in the page as soon as the page starts scrolling a little.
You can use
$(document).on( 'scroll', function(){
});
On click of button, use the below code
$("#scrollUp").on('click', function(){
$(window).scrollTop(0);
});
Happy coding!
RelicV