I am trying to match what is in the json string/array to what the td value is.
Here is the jquery i use to compare the data:
$('td.status4').each(function(){
var tr=$(this).closest('tr');
if ($(this).text() == '48.4') {
tr.css('background-color','#f4f1a2');
}
});
The json data is like so:
Object {71: “48.4”, 72: “48.2”, 73: “48.3”, 74: “48.5”, 75: “48.1”, 76: “54.4”, 77: “54.3”, 78: “54.5”, 79: “54.1”, 80: “54.2”, 81: “67.3”, 82: “67.4”, 83: “67.2”, 84: “67.1”, 85: “49.1”, 86: “49.2”, 87: “49.3”, 88: “49.4”, 89: “55.1”}
What i would like to do is compare the td value in the first code snippet and if there is a match, change the tr background color. I just can’t figure out how to compare the json to the td value.
Thanks for any help!