After jquery gets the DIV location, how to change the number all the time without refreshing it?

my question is simple. I just can"t remember how to implement it.
when you drag a window, the header TITLE displays a numeric value.
when you drag a window, it will change only if it is refreshed. How to keep it changing without refreshing it?
CSS:

div{
     position: absolute;
     top: 0;
     left: 0;
     width: 100px;
     height: 100px;
}

HTML:

<title></title>

jquery:

var divs=  $("div").offset().left;

       if(divs > 100){
            $(this).attr("title",divs);
        }else{
            $(this).attr("title",divs);
        }
Mar.21,2021

onresize


that's right. Isn't this a page load judgment? the code is executed once. You should put the judgment in the function and trigger it

every time you drag it.
Menu