Scroll the transverse (x-axis) and vertical direction (y-axis), in order to scroll to the top of the page, it is necessary to x and y axes set to 0, the need to use the scroll elements: el.scrollTop and el.scrollLeft properties.
document.scrollingElement.scrollTop = 0;
document.scrollingElement.scrollLeft = 0;