JSFiddle - React, Tailwind, and code Playground
HTML
<table id='tableid'>
<tr id='rowid'>
<td>Mohit</td>
<td>23</td>
<td>
<span onclick="removeParents(this, document.getElementById('rowid'));">Delete</span>
</td>
</tr>
</table>
JavaScript
function removeParents(e, root) {
root = root ? root : document.body;
var p = e.parentNode;
while (root != p) {
e = p;
p = e.parentNode;
}
root.removeChild(e);
}