The accepted answer on How to fade, animate and change text, word in title / sentence does a great job at replacing and animating words in a sentence.
How can I also change the color of those word(s), based on a predefined array of colors?
The accepted answer on How to fade, animate and change text, word in title / sentence does a great job at replacing and animating words in a sentence.
How can I also change the color of those word(s), based on a predefined array of colors?
You could resolve it using CSS instead of Javascript with nth-child selector in this way:
[data-words] > span:nth-child(2){
color: blue;
}