I didnt find an answer that I could understand. I am trying to test if a div that was clicked has a background color of ‘red’ … instead of red (in an alert) I am getting rgb(125,0,0) …. tried testing that with single quotes and it didnt work… any help please?
alert($('#' + id).css('background-color'));
if ($('#' + id).css('background-color') == 'red') {
$('#' + id).hide('slow');
}
It would be a whole lot easier if you gave the divs the background color using a CSS class, then simply tested for the presence of the class. Color is less semantic than the class, anyway.