I am trying to select the previous table cell of a non-empty table cell.
I have the following code.
THIS WORKS (Highlight all empty cells)
$("td.brand:empty").css('background-color', 'red');
THIS WORKS (Highlight all non empty cells)
$("td.brand:not(:empty)").css('background-color', 'green');
THIS DOESN'T WORK (Highlight the previous cell of a non empty cell)
$("td.brand:not(:empty)").prev("td.brand").css('background-color', 'yellow');
All help is appreciated.
Thanks