title: Changing color of a certain word in a paragraph using js
body: <pre><code>$('#txtInput').keyup(function(){
  
      var txtInput = $(this).val();
  
      localStorage.setItem('inputData', txtInput);
  
      var returnData = localStorage.getItem('inputData');
      $('#txtInput').val(returnData);
  
      var hasTest = returnData.includes(&quot;&lt;h1&gt;&quot;);
  
      if(hasTest == true){
          
      }
  });
  </code></pre>
  <p>I'm creating a text editor using js.Here I'm using localStorage to store data and retrieve data.I need to add highlighting syntax feature.</p>
  <p>For example : If 'h1' found from the text, color the 'h1' to red.I used &quot;.includes() and it finds the word but I have no idea how to change the color of the found text.I really appreciate your help</p>