I need to create a function that outputs only the id of any image whenever the user click on it. (Javascript or jQuery it doesn’t matter)
<table>
<tr>
<td id="1"><img src="image1.gif"></td>
<td id="2"><img src="image1.gif"</td>
<td id="3"><img src="image1.gif"</td>
</tr>
</table>
Add a class to your table:
Then delegate the binding:
Demo: http://jsfiddle.net/Uz2pW/