Please help. . I just encountered a problem about the adaptation of document.documentElement.scrollTop and document.body.scrollTop. I read online that document.documentElement.scrollTop is used in standard mode. . But why do I test that the value of document.documentElement.scrollTop is always 0 in HTML5 standard mode, while document.body.scrollTop has a value?
Different browsers process different results
Poke me
Browser compatibility issue.
It is recommended to write
let top = document.documentElement.scrollTop || document.body.scrollTop