I have a div with id="test" What I am trying to do is to resize the div to body.clientHeight-80px . So that the height of the element fills all the visible space on a browser window (without scrolling) except the 80px high header. I have js code as below:
let Height = document.body.clientHeight-80;
let myElement = document.getElementById("test");
myElement.style.height = Height;
The code will work fine if I use something like :myElement.style.height = "600px";.
I think the problem is that document.body.clientHeight; is returning a value without the unit px.