how to access element whose id is variable
<p>I need to access elements in html file using javascript, their names are like <code>arr_1</code>, <code>arr_2</code>, <code>arr_3</code>, i wish to use a loop to dynamically create the id then to access them like below:</p>

<pre><code>for(var i=0; i&lt; 10; i++) {
  var id = "arr_" + i;

  $document.getElementById('id')....

}
</code></pre>

<p>but it doesn't work. i remember there is an function to allow me do that, anyone know what that is?</p>
