window.pageYOffset vs document.documentElement.scrollTop
javascript
Solution
Both window.pageYOffset and document.documentElement.scrollTop returns the same result in all the cases.
Yes, window.pageYOffset is not supported below IE 9.
scrollTop() method also can be used to get the vertical scrollbar position of the specific element.
Problem
In Javascript `window.pageYOffset` and `document.documentElement.scrollTop` both measures the distance of an window top to its topmost visible content in pixel. Are they both same or am I missing something? Trust `window.pageYOffset` is not supported for IE < 9 but if assuming IE >8 then - When to use each of them - difference between them