JSFiddle - React, Tailwind, and code Playground
by Matt Ball
HTML
<table width="301" border="0" cellspacing="5" cellpadding="0" id="selectedproducts">
<tbody>
<tr>
<th width="56" scope="col">Product:</th>
<th width="48" scope="col">Size:</th>
<th width="71" scope="col">Colour:</th>
<th width="41" scope="col">Qty</th>
<th width="55" scope="col">Price</th>
<th width="55" scope="col">Delete</th>
</tr>
<tr id="product_1">
<td>Shuttle</td>
<td>54.95</td>
<td>Red</td>
<td>1</td>
<td></td>
<td><a onclick="deleteProduct(this)">[X]</a></td>
</tr>
<tr id="product_2">
<td>Shuttle</td>
<td>54.95</td>
<td>Red</td>
<td>1</td>
<td></td>
<td><a onclick="deleteProduct(this)">[X]</a></td>
</tr>
</tbody>
</table>
JavaScript
function deleteProduct(elt) {
$(elt).closest('tr[id]').remove();
}