Convert jQuery to JavaScript ( When i scroll down to specific area (Div ID) load HTML Content one time)

Hi, in this code, already is working with jquery, but how can i convert to JavaScript the following:

$(window).on("scroll", function () {
    if (checkVisible($("#target"))) {
            `HTML CONTENT`

    } else {
        // do nothing

function checkVisible(elm, eval) {
    eval = eval || "object visible";
    var viewportHeight = $(window).height(), 
        scrolltop = $(window).scrollTop(),  
        y = $(elm).offset().top,
        elementHeight = $(elm).height();

    if (eval == "object visible")
        return (
            y < viewportHeight + scrolltop && y > scrolltop - elementHeight
    if (eval == "above") return y < viewportHeight + scrolltop;

the second part, works with jquery, but should be in JavaScript only

how can i do it, many thanks

here’s working with jquery, but i want in javascript

Looking at the code I guarantee it doesn’t work. Putting aside that you’re shadowing the most hateful function in JS eval, you never provide a value for it in the actual call, so this line:

eval = eval || "object visible";

will always result in "object visible" (even if it’s not)