In my table, I have multiple rows with alternating white and grey backgrounds achieved through CSS.
.profile tr:nth-child(odd) { background:#eee; }
.profile tr:nth-child(even) { background:none; }
However, I now want to allow users to select a row and have it highlighted in yellow using JQuery.
$(".Select").click(function() {
//Deselect all other Rows
$(".Select").show().prev().hide().parent().parent().css('background', 'none');
//get Id
var Row = $(this).parent().parent();
var MatchId = Row.attr('id');
$(this).hide().prev().show();
Row.css('background', '#FFFFBA');
});
The issue arises when selecting all rows with the $(".select")....parent().parent().css('background....
Setting it to "none" turns all rows white and disrupts the alternating color scheme. Is there a way to restore the background property to its original state?