Javascript error - document.getElementsById is not a function
<p>Since I am calling this code in loop. But following code is giving me error as <code>document.getElementsById</code>  is not a function. What should I do how can I call doc.getbyid in loop.</p>

<pre><code>for (var z=1; z &lt; i; z++){
       var textbox = document.getElementsById("a"+z).value;
       var textbox2 = document.getElementsById("b").value;
       var textbox3 = document.getElementsById("c").value;
       alert(textbox);
       alert(textbox2);
       alert(textbox3);
}
</code></pre>
