Jquery Parent Item of Div containing X content.
- by fighella
I need to add a CSS class to the TR (or multiple TR's) of the parent of a TD containing some specific text.
Because of the CMS I can't control the code, but I can add some Jquery and CSS.
I've tried a few things, but I've had no luck.
Here is an example of what I had in mind.
<style>
tr.highlight { background: Blue;}
</style>
<table>
<tr>
<td>
Pet
</td>
<td>
Number of Legs
</td>
</tr>
<tr>
<td>
Cat
</td>
<td>
4
</td>
</tr>
<tr>
<td>
Doggie
</td>
<td>
4
</td>
</tr>
</table>
And I essentially want the jquery to add that class (highlight) to the offending TR.
** I know this is not an ideal approach, but desperate times call for desperate measures. **
Thanks for your help.