function toggleLinkSelection(link){
if($(link).css('border-top-color') == 'red'){
$(link).css({'border-top-color': 'transparent'});
} else {
$("div[id$='OptionsLink']").css({'border-top-color': 'transparent'});
$(link).css({'border-top-color': 'red'});
}
}
Am I doing something wrong in my if statement? It never tests true. In the browser I inspect item and it should test true. I’ve tried replacing red with #F00 and #FF0000 and that doesn’t help.
The link variable = #testID
Thanks.
colors are returned in rgb
ps: always use 3 equals when you know what the output will be, or you could end up with some nasty surprises
EDIT: demo by JesseB (see post below)