title: How to change color of text in a textarea
body: <p>I have a <code>textarea</code> and when I type something, for some words the color should change.</p>
  
  <p>For example, if the typed text is next one: <code>He went to the market to buy an apple</code></p>
  
  <ol>
  <li>The "market" word should become <strong>green</strong></li>
  <li>The "apple"  word should become <strong>red</strong></li>
  </ol>
  
  <p>This is my current code: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var str = 'market';
  var value = str.includes('market');
  
  if (value == str) {
      document.getElementById("text").style.color = "green";
  } else {
      document.getElementById("text").style.color = "red";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;textarea rows="9" cols="100" id="text" onClick="changeText();"&gt;&lt;/textarea&gt;</code></pre>
  </div>
  </div>
  </p>