Hi I am using jQuery and creating tags in a loop.
Ex -
for(var i=0;i<length;i++){
jQuery("#dailydata").append("<table class='table'><tr>"+
"<th>Min Temp : </th><td>"+ data[i]</td>" +
"</tr></table>";
if(data[i] <=10){
//add color to th
}else{
//add different color to th
}
}
I am creating a Table Row in every loop and appending to a HTML element. and just after that I am checking the value and according to that value I want to change the background color of the tag.
Can somebody tell me how to achieve this?