parentTR.children().each(function(i, elem) { if(i > 0) { var j =(i - 1) % 5 ; $(elem).text(fromBD.childNodes[j].innerHTML); } }