I have a textarea containing the text:"Hello World".
Is there a way to change the color of only "World" with jquery?
I can get the value I want to edit with the slice method:
$('textarea').val().slice(6);
But how can I apply a css rule or class to only that part of the textarea value?
I don’t think this is possible you would have to use something other than textarea. I would rather answer this with a “it’s not possible” rather than leaving it unanswered.
After searching for a few minutes I found an old post on SO with the same question: How do I have different font colors in a textarea?
Correct me if I’m wrong.