In my HTML page I have a number of span tags with a class named "Tested". I need some jQuery code that finds all of these span elements with that class name and also contains span text of "TE" anywhere in the text. I would then like to change the color of the text to red.
Try with filter and each
$('span.Tested').filter((index,obj) => $(obj).text().indexOf("TE")>=0 )
.each((index,obj) => $(obj).css('color', 'red') );
Edited:
$('span.Tested').filter((index,obj) => $(obj).text().indexOf("TE")>=0 ).css('color', 'red');