javascript – Check for scroll in JS

Question:

Can you please tell me how to check if there is a scroll on the page or not?

Answer:

if document.scrollHeight is equal to document.offsetHeight then there is no scrolling

Scroll to Top