I'm looking to loop through the rows of a table and checking to see what color they have for background. This is what I have so far:
var TheColor = "";
$('#MyTable tr').each(function () {
TheColor = "";
TheColor = $(this).attr('background-color');
alert(TheColor);
});
When the loops unfolds, all I'm getting is "undefined" and I'm not seeing why. However, when I write TheColor = $(this).html(); I'm getting the expected output.
Thanks for suggestions.