$(".btn-add-dependent").click(function () {
var checked = $("#disability").is(':checked') ? "checked='checked'" : "";
$("#dependents-info tbody").append(
"<tr><td>" + $("#first-name").val() + "</td><td>"
+ $("#middle-name").val() + "</td><td>"
+ $("#last-name").val() + "</td><td>"
+ $("#dependents-birthday").val()
+ "</td><td><input type='checkbox' disabled='disabled'" + checked
+ "</td><td><button><span class='btn-edit-dependent glyphicon glyphicon-pencil'></span></button><button><span class='btn-delete-dep glyphicon glyphicon-trash'></td></tr>");
});
// delete dependent button
$('.btn-delete-dep').click(function () {
alert('m;lasfdj;adsdas');
});
1 个解决方案
#1
0
$('#dependents-info').on('click','.btn-delete-dep',function () {
alert('m;lasfdj;adsdas');
});
#1
0
$('#dependents-info').on('click','.btn-delete-dep',function () {
alert('m;lasfdj;adsdas');
});