When it comes to conditionally changing the background-color of TDs based on a certain value, I've encountered some browser inconsistencies. The code snippet below works smoothly in IE and Firefox, but Chrome fails to display any color at all.
I've even attempted using rgb(255, 255, 0) as an alternative, only to face the same issue with Chrome version 33.0.1750.154 m, which appears to be the most recent version available.
Are there any tweaks or workarounds that would guarantee consistency across all three browsers?
Snippet from my code:
$('.search').click(function() {
var value = $(this).text();
var color = $(this).css('background-color');
if(color == 'transparent') {
$('td')
.css('background-color', '')
.filter(function(){
return $(this).text() === value;
})
.css('background-color', 'yellow');
//...
Thank you for your help in advance, Tim.