title: getElementById and onLoad
body: <p>HTML file ...</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;script type="text/javascript" src="src/myJS.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="myJS.myFunction();"&gt;
  &lt;p id="p01"&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>External Javascript file (called myJS.js for convenience) ...</p>
  
  <pre><code>myJS = {
      myFunction: function()
      {
          //This works
          document.write("Hello world. ");
  
          //This does not work
          document.getElementById("p01").appendChild(document.createTextNode("Hello world, again"));
      }
  };
  </code></pre>
  
  <p>My best guess is that the node <code>p01</code> has not been created when <code>myJS</code> is executed, but I thought that <code>onload</code> would do the right thing with it.</p>