How to use array value in getElementById?
<p>I have php array like this :</p>

<pre><code>&lt;form name="qwerty"&gt;
    &lt;? foreach ($products as $product)?&gt;
    &lt;input type="text" name="price1[]" id="&lt;? $product['id']?&gt;" value="&lt;? $product['price1']?&gt;" onkeyup="copy()"/&gt;

    &lt;input type="text" name="price2[]" id="&lt;? $product['id']?&gt;" value="&lt;? $product['price2']?&gt;" /&gt;
    &lt;? end foreach?&gt;
&lt;/form&gt;
</code></pre>

<p>how to use that id value in this javascript code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function copy()
{
  var cc1 = document.getElementById('???????');
  var cc2 = document.getElementById('???????');
  cc2.value = cc1.value;
}
&lt;/script&gt;
</code></pre>
