jQuery event listener for when text has changed in a <td> cell? -
is there way in jquery attach listener cell when text inside cell has changed (by javascript, not user), event triggered?
to extend mway's answer, here code.
var td = $('#my-table tr td:eq(1)'); var tdhtml = td.html(); setinterval(function() { if (td.html() !== tdhtml) { // has changed tdhtml = td.html(); } }, 500);
... , second suggestion.
function updatetd(html) { $('#my-table tr td:eq(1)').html(html); // additional code }
you bind domsubtreemodified
event element, browser support isn't best.
Comments
Post a Comment