title: Why is document.getelementbyId not working in Firefox?
body: <p>I can't figure out why document.getElementById is not working in Firefox:</p>
  
  <pre><code>document.getElementById("main").style.width = "100";
  </code></pre>
  
  <p>When I check in Firebug it says:</p>
  
  <p>TypeError: document.getElementById("main") is null</p>
  
  <p>Does anybody know why this is happening?</p>
  
  <p>EDIT: Unfortunately, the "body" element was a bad example. I changed it to another element with an id of "main".</p>