title: JS - set window height using current window size
body: <p>I have some CSS that needs the body to have a height set, but this needs to be done depending on the user.</p>
  
  <p>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?</p>
  
  <pre><code>function setWindowHeight(){
      var windowHeight = window.innerHeight;
      document.getElementsByTagName('body').style.height = windowHeight + "px";
  }
  </code></pre>