I tried number of different combinations put 2 hours of attempts got me nowhere. How can I merge the 2 filter functions in one if .. else ..
statement?
$('.app-layout .app-co .badge')
.filter(function(){ return $(this).text() == 'Off'; })
.addClass('bg-palette-yellow text-palette-dark-gray');
$('.app-layout .app-co .badge')
.filter(function(){ return $(this).text() == 'On'; })
.addClass('bg-palette-green text-palette-dark-gray');