Im trying to target the first word of each line to change the color to only the first word on it. Right now this is being populated by a textarea on the backend.
textarea
Try something like this in a loop:
var firstWord = $(this).text().split(" ")[0]; var newText = $(this).text().replace(firstWord, ""+firstWord +""); $(this).html(newText);