title: document.getElementByID("test").innerHTML giving TypeError: 'undefined' is not a function (evaluating 'document.getElementByID("test")')
body: <p>I am trying to use javascript to set the inner html of a div, but for some reason, it isn't working. I have found that others have had this problem before, but none of the solutions I found in other posts works.  I don't understand what's wrong.</p>
  
  <p>Here is my test function:</p>
  
  <pre><code>function test(){
      document.getElementByID("test").innerHTML = "why won't you work";
      alert("hello");
  }
  window.onload = test;
  </code></pre>
  
  <p>The function is being called because the alert box works if the document.getElementByID line is commented out.  It doesn't work if that line isn't commented.  My console is showing an error for that line: </p>
  
  <pre><code>TypeError: 'undefined' is not a function (evaluating 'document.getElementByID("test")')
  </code></pre>
  
  <p>And of course, I have a div with that id in the body of my page.</p>
  
  <pre><code>&lt;div id="test"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Everything I have found online says that this should work. I am lost. Any help would be greatly appreciated.</p>