I needed something like this for my project, based on the text of the links.
jQuery
$(".content:contains('low')").addClass("green");
$(".content:contains('medium')").addClass("yellow");
$(".content:contains('high')").addClass("orange");
$(".content:contains('critical')").addClass("red");
The key is the :contains() function.
CSS
.red { color: red; }
.green { color: green; }
.orange { color: orange; }
.yellow { color: yellow; }
HTML
<div class="content">
<p>high</p>
</div>
<div class="content">
<p>low</p>
</div>
<div class="content">
<p>medium</p>
</div>
<div class="content">
<p>critical</p>
</div>
jsfiddle
I'm pretty new to jQuery, so there still might be a better way.