title: Get the value of the body id and store as a variable in js
body: <p>I have a need to change something within a page depending on the body tag id.</p>
  
  <p>My code doesn't seem to work, can you help?</p>
  
  <pre><code>function changeHeaderTitle(){
      var bodyId = document.getElementsByTagName("body").id;
      alert(bodyId);
  }
  </code></pre>
  
  <p>This just echoes "undefined".</p>