I was attempting to calculate the dimensions of a static header identified as "headbar" in order to create an offset for the main page. The JavaScript code appears to be functioning properly based on the console.log output. However, the CSS is not updating and I am uncertain as to why. Is there anyone who can assist me with this issue?
Below is the provided JavaScript code:
headresize();
window.addEventListener('resize', headresize);
function headresize(){
var h = document.getElementById("headbar").clientHeight;
document.getElementById("logo").style.paddingtop = h+"px";
var c = document.getElementById("logo").style.paddingtop;
console.log(h+"px");
console.log(c);
}