Reputation: 751
I thought the following code would work for my needs
$("td[style='background-color: #FFBBBB']").css('background-color', '#333');
but the problem I am facing is that each td
has different values within the style
attribute for instance:
font-weight: normal;background-color:#FFBBBB;
and the code above doesn't seem to execute since there are multiple values. How can I account for this?
Essentially I want to change elements with the background color of #FFBBBB
to another color.
Upvotes: 0
Views: 57
Reputation: 1
Try utilizing Attribute Contains Selector [name*="value"]
$("td[style*=#FFBBBB]").css("background-color", "#333");
Upvotes: 1