Change main image src attribute according thumb image click
<p>i need to change main image src attribute according thumb image click.
But i getting only first thumb image src, not getting other thumb image src why this ?</p>

<pre><code>$(document).ready(function(){
$("#simg").click(function(){
    alert($(this).attr('src'));
});  
});

&lt;img src="main.jpg"  /&gt;

&lt;table width="100%" border="0" cellpadding="0" cellspacing="0" class="paddingTop"&gt;
&lt;tr&gt;
&lt;td align="left" valign="top"&gt;&lt;img src="1.jpg" border="0" id="simg" /&gt;&lt;/td&gt;
&lt;td align="left" valign="top"&gt;&lt;img src="2.jpg" border="0" id="simg" /&gt;&lt;/td&gt;
&lt;td align="left" valign="top"&gt;&lt;img src="3.jpg" border="0" id="simg" /&gt;&lt;/td&gt;
&lt;td align="left" valign="top"&gt;&lt;img src="4.jpg" border="0" id="simg" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
