JSFiddle - React, Tailwind, and code Playground

HTML

<div id="footer"></div>

CSS

#footer {
    margin: 0 auto;
    width:500px;
    height:40px;
    background-color:#666;
}

JavaScript

$(function(){
 
    // initial position:    
    docHeight = $(window).height();
    $('#footer').css('margin-top', docHeight + 'px');
   
    // position when I resize the window:
    $(window).resize(function() { 
    //docHeight = $(window).height();
        $('#footer').css('margin-top', docHeight + 'px');
    });

})