title: css on a class depending on what is contained
body: <p>I have a share point calender and i want to color code difrent blocks depending on what reg number they contain (its for a school's minibuses)</p>
  
  <p>How do i set the background color of .ms-cal-eworkday if a.ms-cal-tweekitem contains "EF04 WTR"</p>
  
  <p>I need to do this in js/jquery as i don't have the abity to edit the aspx (council politics)</p>
  
  <p>Each entry looks like this.</p>
  
  <pre><code>&lt;td class="ms-cal-eworkday" rowspan="6"&gt; 
      &lt;table cellpadding="0" cellspacing="0" border="0" class="ms-cal-tweekitem" dir=""&gt;
      &lt;tbody&gt;&lt;tr&gt;
          &lt;td valign="top" href="/schools/ecclesfield/newdemosite/minibus-booking/Lists/Minibus/DispForm.aspx?ID=3" onclick="GoToLink(this);return false;" target="_self"&gt;
           &lt;div&gt;
            &lt;img src="/_layouts/images/blank.gif" width="50" height="1" alt=""&gt;&lt;br&gt;
            &lt;img src="/_layouts/images/recursml.gif" class="ms-cal-hidden" alt="" align="absmiddle"&gt;
            &lt;a onfocus="OnLink(this)" class="ms-cal-dayitem" href="/schools/ecclesfield/newdemosite/minibus-booking/Lists/Minibus/DispForm.aspx?ID=3" onclick="GoToLink(this);return false;" target="_self" tabindex="5"&gt;
              &lt;nobr&gt;03:00 PM&lt;/nobr&gt;
              &lt;br&gt;
              &lt;b&gt;test2&lt;/b&gt;
              &lt;br&gt;
              EF04 WTR
              &lt;/a&gt;
           &lt;/div&gt;
           &lt;/td&gt;
       &lt;/tr&gt;
       &lt;/tbody&gt;&lt;/table&gt;
  
  &lt;/td&gt;
  </code></pre>
  
  <p>I know the code is a bit of mess that's just how sharepoint works :(</p>
  
  <p>Thanks in advance.</p>
  
  <p>Lewis</p>