JS - set window height using current window size

Mahdi

New Member
I have some CSS that needs the body to have a height set, but this needs to be done depending on the user.I have made some code that kind of works - it calculates the window height but it's not changing the body height. What am I doing wrong?\[code\]function setWindowHeight(){ var windowHeight = window.innerHeight; document.getElementsByTagName('body').style.height = windowHeight + "px";}\[/code\]
 
Back
Top