I have a code that I call from Button_click
event.
The code adds a new row to the table and attempts
to add onclick element to every td element in the new row.
Somehow, onclick does not work.
Any help is appreciated.
Here is the code:
function insRow()
{
var x = document.getElementById('Table1').insertRow(1);
for(i=0;i<4;i++)
{
var td = document.createElement('td');
td.innerHTML = 'NewItem';
td.setAttribute('onclick', 'alert("blabla")');
x.appendChild(td);
}
}