title: Javascript Not Detecting HTML Elements
body: <p>Okay, believe me that I have many "p" tags on my HTML document. Here is my Javascript code:</p>
  
  <pre><code>var elements = document.getElementsByTagName('p');
  var i;
  window.onload = clicker();
  function clicker() {
      alert(elements.length);
      for(i=0;i&lt;elements.length;i++) {
          alert('looping');
          elements[i].onClick = function() {
              this.style.color = '#33CC33';
          }
      }
      setInterval(clicker, 0);
  }
  </code></pre>
  
  <p>Notice my first alert statement in there. It alerts "0" to me, which makes no sense. My problem is that none of the "p" tags are being stored in the elements variable at all, therefore making my for loop not run. The HTML is filled with a lot of PHP but here is the top snipped to prove to you that I do have a "p" tag:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
      &lt;head&gt;
          &lt;title&gt;Gwiddle - FTP&lt;/title&gt;
          &lt;link rel='stylesheet' type='text/css' href='stylesheet.css' /&gt;
          &lt;script type='text/javascript' src='script.js'&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id='banner'&gt;&lt;p&gt;Gwiddle FTP&lt;/p&gt;&lt;/div&gt;
  </code></pre>