I've created a pretty short fiddle that demonstrates the use of jQuery to change the color of a piece of text.
HTML:
<p id="paragraph">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium?</p>
<button id="colorChanger">This Button changes the text color of the paragraph.</button>
CSS:
#paragraph {
color: green;
}
JavaScript:
$('#colorChanger').click(function() {
$('#paragraph').css('color','black');
});
The code above shows that with any text you can change the color using jQuery's css method. Additionally, I used #paragraph
to access the paragraph; however, you can use nth-child through jQuery, you can cycle through the children of a container using a loop and checking for the right one then using the css method from jQuery. These are just a few of the ways to change the color of a piece of text.