I have a jquery app which consist of a table. The table has a time field and some number fields. I want to basically increment the values every 3 seconds. So i was thinking of c
Try this code on interval function:
$("#example > tbody tr").each(function(){
var s = 0; //--- var for not increase 1st td ---
$("td",this).each(function(){
var data = $(this).html();
if(/^[0-9]+\.?[0-9]*$/.test(data)){
$(this).html(++data);
} else {
if(s == 1) {
date = new Date();
var h = date.getHours();
var m = date.getMinutes();
if(m < 10) {m = '0'+m;}
$(this).html(h+':'+m);
};
s = 1; //--- after 1st td increase ---
}
});
});
JSFiddle