title: GetElementsByName with array like name
body: <p>i often use this notation when i name my controls in order to get an array in POST or GET.</p>
  
  <pre><code>&lt;input name="color[1]" type="text" /&gt;
  &lt;input name="color[2]" type="text" /&gt;
  &lt;input name="color[3]" type="text" /&gt;
  </code></pre>
  
  <p>so in my scripts i can do</p>
  
  <pre><code>&lt;?php $data=$_GET["color"]; 
  for each ($color as $key=&gt;$value) {
     doSomething();
  } ?&gt;
  </code></pre>
  
  <p>Often happens that i need to get those id back in javascript , but i cannot get them , so i often add an ID to each element in html like that</p>
  
  <pre><code>&lt;input name="color[3]" id="color_3" type="text" /&gt;
  </code></pre>
  
  <p>so that i can use document.getElementsById('color_3')</p>
  
  <p>Instead i would like to find way to use document.getElementsByName(color[3])... 
  but i cannot really get it to work.</p>
  
  <p>Any help?</p>