I'm attempting to emphasize a table row with a specific item ID (found in the first column) by updating its CSS class, however, for some reason it isn't working as expected:
.inactive {
background-color: "red";
}
Whenever a particular event occurs, my code triggers the following JavaScript function:
function highlight_item(item_id){
var tableRow = $("#itemsTable tr td:first-child").filter(function() {
return $(this).text() == item_id
}).parent();
tableRow.addClass("inactive")
}
Oddly enough, replacing the addClass()
method with
tableRow.css("backgroundColor", "red")
seems to work. What could I be doing incorrectly here?