gph

msg:1471358 | 4:40 pm on Dec 24, 2005 (gmt 0) |
I don't think the approach is correct. If you want to move the image you need a reference to it and the td. onclick="getmove(this)" then in the function function getmove(img){ var td=img.parentNode; ... }
|
purefan

msg:1471359 | 7:51 pm on Dec 24, 2005 (gmt 0) |
thank you for posting. I found another way:
<td id="a8" onClick="getmove(this.id);" bgcolor="#FFFFFF"><img src="bitmaps/trans/br2.gif"></td> to add the onclick to the TD itself. this is working for me but I will give it a try to your code a bit later. Thanks again!
|
Bernard Marx

msg:1471360 | 1:30 am on Dec 25, 2005 (gmt 0) |
Since you are likely to only be using the id to get a reference to the clicked element using getElementById, you might as well just pass the ref itself (this), as suggested, and save the effort.
|
|