I have a button in my table, I want to remove a complete row on button click.? please dont try to modify the logic i used.
Currently when the button is clicked I get its id
and based on that id
i need to delete an element(complete row) from the DOM having same class name.
JavaScript
$(".removeAKA").click(function () {
// alert($(this).val());
var id = this.id;
alert(id);
$("." + id).remove();
});
HTML
<tr class="aka 1" id="sdf">
<td>AKA 1</td>
<td><input class="text-box single-line" id="aka_1_" name="aka[1]" type="text" value="2" /></td>
<td><input type="button" class="removeAKA" id="aka 1" value="Delete" /></td>
</tr>