0
我添加动态超链接,并希望执行点击事件时,如果用户点击它,但它不会启动。在表中点击动态添加超链接点击
<table id="assinged_areas" class="table table-bordered table-condensed table-condensed">
<tbody></tbody>
</table>
当用户选择在下拉一些选项,然后它去,并从服务器领域则AJAX通过将数据传递给这个函数
function updateAssignedAreas(data) {
debugger;
var areas = data.split(',');
$.each(areas, function (i, item) {
$('#assinged_areas > tbody:last').append('<tr><td>' + item + '</td><td>' + '<a class=\'btn btn-danger\'><i class=\'fa fa-minus-circle\'></i></a>'
+ '</td></tr>');
});
}
这是取消分配,当用户点击该功能得到调用这个函数必须调用但在所有
$('.btn-danger').click(function (parameters) {
debugger;
});
作为Anoop说,http://learn.jquery.com/events/event-delegation/ –
嗨,谢谢你的答案,我怎样才能得到单击按钮的行细节 –
@ineffablep你可以分享最后呈现的HTML? –