how to get image id
<p>I am creating a list of images dynamically, following is the code</p>

<pre><code>&lt;?php
for ( $counter = 0; $counter &lt; $obj1-&gt;id; $counter ++)
{ ?&gt;
&lt;tr&gt;&lt;td&gt; Week &lt;?php echo($counter+1); ?&gt;
&lt;/td&gt;&lt;td&gt;&lt;?php echo" &lt;a href=\"#hiddenDiv\" rel=\"facebox\";&gt;";?&gt;
&lt;img src="tue.png"/ id="image" value="&lt;?php echo $counter+1;?&gt;" &gt;
&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;?php } ?&gt;
</code></pre>

<p>when the user clicks on the image a form opens. every image represents a week so i need to uniquely identify on which week user is inserting data. i need id of that image through which i can identify a week.
On click at the image following function is called</p>

<pre><code>function pc(){
var temp = document.getElementById("image");
alert(temp.value);
}
</code></pre>

<p>but i am getting "undefined". can somebody help me with this?</p>

<p>Thanks</p>

<p>Thanks in advance</p>
