I would like to hide <tr>
's based on background color of a <td>
in the <tr>
, my current code hides the <tr>
's based on the text in the <td>
but that is not really a nice solution. The table is a calender so it would be nice if the JQuery could hide a table row based on background color.
My current code:
function ShowAbsence()
{
if(!presenceActive) clearPresence();
$('table#newspaper-a tr:not(#header, #trWeekNummer)').each(function() {
var toggle1 = true;
$('td:not(#firstlastname)',this).each(function() {
if($(this).text() == "f" || $(this).text() == "M" || $(this).text() == "A") {
toggle1 = false;
}
});
if(toggle1) {
$(this).toggle();
}
});
if(absenceActive) {
absenceActive = false;
} else {
absenceActive = true;
}
}
This works fine, but as you can see it hides based on the text in the cell. I hope you can help me hide it based on background color!