title: Cannot set property 'innerHTML' of null
body: <p>Why do I get an error or Uncaught TypeError: Cannot set property 'innerHTML' of null?
  I thought I understood innerHTML and had it working before.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  
  &lt;script type ="text/javascript"&gt;
      what();
      function what(){
          document.getElementById('hello').innerHTML = 'hi';
      };
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="hello"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>