I have a table with 64 squares representing a chess board.
on some squares I have images (for the pieces) and I am trying to allow the user to do a click-click and move the piece to its new location.
The <TD> have been IDed (from a to h for the columns and 1 to 8 for the rows).
I approached it by setting the onclick event on the images but it doesnt give me the id of its container <TD>.
here is my last try:
<td id="a8" bgcolor="#FFFFFF"><img src="bitmaps/trans/br2.gif" onClick="getmove(window.event.srcElement.id);"></td>
the function getmove only shows an alert with parameter for testing purposes. I read somewhere about this srcElement.id but my firefox says that srcElement has no properties.
in short: how do I get the ID of the <td> containing the onclicked image?