title: Search for an item in a list using jquery .filter()
body: <p>I'm trying to input an input that looks into my list and returns the result below.</p>
  
  <p>This is my list</p>
  
  <pre><code>&lt;ul id="lista1" class="list-group"&gt; 
      &lt;li id = "1" class="list-group-item d-flex justify-content-between align-items-center"&gt;
          &lt;p id = "elem1"&gt; Carne &lt;/p&gt;
          &lt;p id = "elem2"&gt; Pesce &lt;/p&gt;
          &lt;p id = "elem3"&gt; Verdure &lt;/p&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Searching online, I found this feature but I can not adopt it in my case because I do not want to change the current list, but that only the search result is reproduced below.</p>
  
  <pre><code>$(document).ready(function(){
    $("#myInput").on("keyup", function() {
      var value = $(this).val().toLowerCase();
      $("#lista1 p").filter(function() {
        $(this).toggle($(this).text().toLowerCase().indexOf(value) &gt; -1).indexOf()
      });
    });
  });
  </code></pre>