Jquery 更改外部事件上动态创建的td的值

Jquery 更改外部事件上动态创建的td的值,jquery,json,datetimepicker,Jquery,Json,Datetimepicker,我有以下代码 html += '<tr id="product_row_scheduled_'+key+'">'; html += '<td class="title">'+image_path+' '+product_row.title+'</td>'; html += '<td class="text-center" id="sch_product_posted_'+key+'"> '+product_row.user_set_time+'&l

我有以下代码

html += '<tr id="product_row_scheduled_'+key+'">';
html += '<td class="title">'+image_path+' '+product_row.title+'</td>';
html += '<td class="text-center" id="sch_product_posted_'+key+'"> '+product_row.user_set_time+'</td>';
html += '<td class="text-center"><a href="#" id="schedule_'+key+'" onClick="schedule_product(\''+key+'\',\''+product_row.title+'\',\''+product_row.user_set_time+'\')"> Schedule</a></td>';
html += '<td class="text-center"><a href="#" onClick="cancel_schedule(\''+key+'\')"> Cancel</a></td>';
html += '</tr>';
但它不起作用。任何帮助都将受到感谢

ID
使用
#
,例如

$('#product_row_scheduled_'+key).on('change', '#sch_product_posted_'+key,function(){
                                  // ----------^ # in place of .
    console.log($(this).html());// use this here
});
使用
class
而不是
id
将非常简单

$(document).on('change', '.sch_product_posted',function(){
    console.log($(this).html());
});
在你的
栏中添加一个类
sch\u product\u posted

更新后
更改
将无法正常使用


为什么不使用公共类进行事件绑定,然后遍历DOM?只需使用“.product\u posted\u'+key”而不是“.product\u posted\u'+key+”@Satpal就可以了,谢谢您的评论。我做错了,还是不走运。我已经将class
schu product\u posted
添加到列中并更新jquery代码,但它不起作用。您的列是如何更改的?注意:您希望在列上应用
更改事件
。您可以使用
上的
单击事件
检查它是否工作。我正在通过外部事件更改列的值。单击
schedule\u product
会出现一个模式,用户可以在该模式中使用引导日期时间选择器更改值。在datetimepicker更改事件中,我要更新此字段。
$(document).on('change', '.sch_product_posted',function(){
    console.log($(this).html());
});
$(document).on('DOMSubtreeModified','.sch_product_posted', function(event){
    console.log('Html: '+$(this).html());
});