diff --git a/files/en-us/web/api/element/scrollheight/index.md b/files/en-us/web/api/element/scrollheight/index.md index 5b6920da6e0b16d..1981092127f1505 100644 --- a/files/en-us/web/api/element/scrollheight/index.md +++ b/files/en-us/web/api/element/scrollheight/index.md @@ -175,7 +175,8 @@ const veryImportantRead = document.getElementById("very-important-read"); // Check if user has scrolled the element to the bottom function isRead(element) { return ( - element.scrollHeight - Math.round(element.scrollTop) <= element.clientHeight + Math.abs(element.scrollHeight - element.clientHeight - element.scrollTop) <= + 1 ); }