$("#btnAdd").click(function () {
$.ajax({
type: "POST",
url: "View.aspx/AddResponsibility",
data: '{"ClientCode":"' + $("#hfClientCode").val() + '","ResponsibilityCode":"' + $("#txtResponsibility").val() + '"}',
async: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
$('#tblRespon > tbody:last').append("<tr><td>" + $("#txtResponsibility").val() + "</td><td>" + $("#txtFullName").val() + "</td><td><a class='delete' id='btnDelete' name='btnDelete' value='" + $("#txtResponsibility").val() + "'>" + "Delete" + "</a></td></tr>");
},
error: function (msg) {
alert(msg.d);
}
});
});
我需要将一个类添加到我要添加的新元素“<a>”中。我在上面尝试的方式似乎没有作为函数工作
$(".delete").click(function () {
不会像通常对页面上已包含的元素那样触发。