How to add a string to a text area with different colours?
<p>I am trying to work out how to write a function where I pass in a string and this string is added to a textarea. This I can do, but I want to parse that string and change the colour on different parts of the string.</p>

<p>In other words, find the words "select", "where" and turn them blue. Then find the words "AND", "OR", "&lt;" and turn them grey and anything in between two single quotes to be the colour red.</p>

<p>I am hoping for a simple function rather than using syntax highlighting libraries, I am not even sure they will work with strings that are dynamically generated.</p>

<p>How can I do this? I am able to make use of JQuery if this makes things easier?</p>

<p>Thanks all</p>
