I have a table:
I have successfully managed to append a row to the table using the following JavaScriptHTML Code:<table> <thead> <tr> <th>...</th <tr> </thead> <tbody> <tr> <td>...</td> <td>...</td> </tr> </tbody> </table>
I call this code using a '+' button in the last column of the table row, i.e.Code:function addRow(tableId) { var table = document.getElementById(tableId); var newRow = table.tBodies[0].rows[0].cloneNode(true); table.tBodies[0].appendChild(newRow); }
I would like now to be able to delete a specific row. The problem is that all the rows are to some degree anonymous. All I have to go on is the row index of the button that was clicked to delete the row. How can I determine the row index of image that was clicked, and use this to somehow delete that row?HTML Code:<a href="javascript:addRow(idOfTheTable);"><img src="plus.gif"></a>
Many Thanks.






Bookmarks