In a JS dynamically generated table, if I do this:
I get no response. When i replace the function nukeNode() with an alert for testing purposes, the event handler is fired not when i click the table row, but when i click the button which builds the table.
Here's the nukeNode() function definition
How can i get this so that clicking on any table row will remove that row from the table?
Code:
var currentRow = document.createElement('tr');
currentRow.setAttribute('onclick', 'nukeNode(this.id);');
I get no response. When i replace the function nukeNode() with an alert for testing purposes, the event handler is fired not when i click the table row, but when i click the button which builds the table.
Here's the nukeNode() function definition
Code:
function nukeNode(nam)
{
var targetNode = document.getElementsByTagName('body').item(0);
targetNode.removeChild( nam );
}
How can i get this so that clicking on any table row will remove that row from the table?