if text contains x, recolor background
by mrjordy
HTML
<table>
<tr>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
Tyson's Ballroom
</td>
</tr>
<tr>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
Vienna
</td>
</tr>
<tr>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
test
</td>
<td>
McLean
</td>
</tr>
</table>
CSS
.blueBack {
background: lightblue;
}
.greenBack {
background: #D6E3BC;
}
.orangeBack {
background: LightSalmon;
}
JavaScript
$("td:contains('Tyson's Ballroom')").addClass("blueBack");
$("td:contains('Vienna')").addClass("greenBack");
$("td:contains('McLean')").addClass("orangeBack");
//$("td:contains('test2')").css("background", "blue");