title: "assignment to undeclared variable" when using "for (i=0; ..)"
body: <p>Hey I'm trying to get list of all input fields in a HTML form, but I get following error(in Firebug):</p>
  
  <pre><code>ReferenceError: assignment to undeclared variable i
  for (i=0 ; i&lt;inputs.length; i++)
  </code></pre>
  
  <p>I don't understant how is "i" undeclared because that is that first part of "for" does.
  This is my formula</p>
  
  <pre><code> function listinputs() 
      {
         var form = document.getElementById("wholeform");
         var inputs = form.childNodes;
         for (i=0 ; i&lt;inputs.length; i++)
         {
            var string=string + inputs[i].nodeName + "&lt;br&gt;";
            var here = document.getElementsByTagName("p");
            here.innerHTML(string);
         }
  }
  </code></pre>