Getting a window scroll in JavaScript

The following (read-only) properties contain how much the window is scrolled:

let x = window.pageXOffset; // from top let y = window.pageYOffset; // from left

On button click, display how much the window has been scrolled vertically.

On button click, display how much is left until the end of the vertical scrolling.

enru