I’m trying to use Jquery to firstly identify specific words within a span tag, and then colour the background of a div it is nested in. The HTML looks like this:
<div class="highlight item1 ll3">
<div class="Image">
<h2 class="Name">
<div class="type">
<span>Workshop</span>
</div>
<div class="Dates">
<p class="Desc">Toddlers are especially welcome to BALTIC on Tuesdays. Join
in the fun, as a BALTIC artist leads a practical session using a variety of
materials,...
</p>
So I think I need to use Jquery to identify if equals “Workshop” then color the div with class highlight (for e.g. set background to #000). I need to repeat this so that each div.highlight that has a different value is given a different color.
Thanks so much in advance.
Jason
Something like this should work: