I want to highlight some items that have the value true.
Here is the code
$('td.obsolete').each(function(index) {
alert($(this).text());
var val = $(this).text();
alert("val:" + val);
if (val === true) {
alert("now then");
$("td.obsolete").css('background-color', '#fef1f8');
}
});
The first 2 alerts work and return False and True as expected when that item is found in the td cell.
The 3rd alert “now then” never gets fired.
I have tried
if (val === true)
if (val == true)
if (val == 'True')
Any clues?
1 Answer