I have a loop in which I make a table like following:
for (k in data['rd']) {
tableData += '<table>... //skipped code
<tr>
.
.
.
<td class="'+data['rd']['time']+'"></td>
</tr>
</table>';
//I want to create a count up on all of the above TD with following
//FormatDate function formats the data into format mm/dd/yyyy hh:mm
document.body.addEventListener("DOMNodeInserted", function(event) {
var elementJustAdded = $('.rd'+k);
elementJustAdded.countdown({since: new Date(formatDate(data['rd'][k]['ordered'])), until: new Date()})
}, false);
}
//Then I attach above "tableData" variable to my div.
Above brief code results in the count down timer only applied to the last TD. So for example if there was say 50 records then only 50th row would display the timer.
Can someone please help me so that I can attach count-up timer to each and every row in the table for given TD.