javascript check if user has scrolled to the botton of the page Edit

Murugan Andezuthu Dharmaratnam | 29 January 2021 | 93

display a console message "reached bottom" when the user has the window to the bottom of the page. please find the code below.

Javascript Code

$(window).scroll(function () {
        if ($(window).scrollTop()   $(window).height() > $(document).height() - 100) {
            console.log("reached bottom");
        }
    });