hi
I use these two functions to totally remove a row from a table.
ONajaee.DOM.Navigation.removeElement = function (elem) {
while (!elem.firstChild)
removeElement(elem.firstChild);
elem.parentNode.removeChild(elem);
}
ONajaee.DOM.Navigation.removeRow = function (sender) {
var sender = window.event.srcElement;
if (sender == null)
return;
var parent = sender.parentNode;
while (parent.nodeName != "TR") {
parent = parent.parentNode;
}
ONajaee.DOM.Navigation.removeElement(parent);
}
this is a working method if you have the following structure
<table>
<tbody>
<tr>
<td>
11
</td>
<td>
12
</td>
<td>
13
</td>
<td>
<div>
<input type="button" class="deleteButton" onclick='removeRow()' value='del' />
<span>hello world</span>
</div>
</td>
</tr>
</tbody>
</table>
but whenever I put the input in a div element and add some text and clutter around this is failing.
can anybody please help me?