title: How to highlight result of a search in Flask/HTML?
body: <p>I m trying to create a search box Using HTML and Flask framework from Python.
  I have the following layout :
  <a href="https://i.stack.imgur.com/slh4g.png" rel="nofollow noreferrer">Layout</a></p>
  <p>I want to take the input of the search box and highlight it in the text zone ! I want to perform a search in the same HTML page !</p>
  <p>For example if I type : &quot;544&quot; the last line will be highlighted.</p>
  <p>I m filling the box automatically with content of a list : Python script :</p>
  <pre><code>@app.route('/update_loc_debug', methods=['POST'])
  def update_loc_debug():
  
  loc_debug = ''
  if loc_debug_msg not in loc_list:
      loc_list.append(loc_debug_msg)
  for i in range(len(loc_list)):
      loc_debug= loc_debug + &quot;\n&quot; + loc_list[i]
  
  return jsonify('', render_template('update_loc_debug.html', loc_debug=loc_debug))
  </code></pre>
  <p>This is the part responsible of filling the box in HTML :</p>
  <pre><code> &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js&quot;&gt;  &lt;/script&gt;
  &lt;script&gt;
  $(function(){
      window.setInterval(function(){
          loadNewLocDebug()
      },3000)
  function loadNewLocDebug(){
      $.ajax({
          url:&quot;/update_loc_debug&quot;,
          type: &quot;POST&quot;,
          dataType: &quot;json&quot;,
          success: function(data){
              $(loc_debug).replaceWith(data)
          }
      });
  }
  });
  &lt;/script&gt;
  
  &lt;div  class=&quot;loc-debug-title&quot;&gt;
      Loc Debug UART
  &lt;/div&gt;
  
  &lt;div id=&quot;loc_debug&quot; class=&quot;textzone3&quot;&gt;
      {{ loc_debug }}
  </code></pre>
  <p>Can you please suggest any possible solution ? or documentation.
  Do I have to use a search form or I can perform the search using live data.</p>
  <p>Thanks!</p>