ABC
ABC Replace Me
ABC
ABC Replace Me
I\'m trying to change any elements containing a particular text string to a red color. In my example I can get the child elements to become blue, but there\'s something about th
you can use match
to find the text inside the particular element
$('#main-content-panel .entry').each(function() {
$(this).css('color', 'blue');
});
$('#main-content-panel .entry').each(function() {
if($(this).text().match('Replace Me')) {
$(this).css('color', 'red');
}
});
ABC
ABC Replace Me
ABC
ABC Replace Me