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? –