JSFiddle - React, Tailwind, and code Playground

by pankaj agrawal

HTML

<div id="div1">test</div>

CSS

#div1
{
    position: absolute;
    top: 350px;
    border: 1px solid red;
    height: 100px;
}

JavaScript

$(function(){
    
 if (($("#div1").offset().top + $("#div1").height()) >= $(window).height()) {
     alert("div is outside the window area");
 }
});