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
:contains is a selector. To check if a selector applies to given variable, you can use is:
:contains
if($(this).is(':contains("Replace Me")'))
However Vega's solution is cleaner in this case.