I want to remove the current row of the table by clicking the button using jquery i have tried this , please help me.
<script>
$(document).ready(function () {
$("#medbtn").click(function () {
var medicinelist = $("#medList").val();
var selecttype = $("#TypeList").val();
var qtyInput = $("#qty").val();
var text = $("#medList").text();
var data = '<tr> <td>' + text + ' </td> <td>' + selecttype + '</td> <td>' + qtyInput + '</td> <td><input type="button" value="X" id="remove"/></td> <input type="hidden" value=' + medicinelist + '/> </tr>';
$('#listMedicine').append(data);
i have tried this here, but not remove the row please help me thanks
$("#remove").click(function () {
$('data').remove();
})
});
});
</script>