$.search

$.search() hides or shows matching elements as the user types in a search box.

In this example, searching in the text box highlights the matching elements in the list.

<input
  type="search"
  data-search="@text"
  data-target=".list .item"
  data-hide-class="d-none"
/>
<ul class="list">
  <li class="item">First item</li>
  <li class="item">Second item</li>
  <li class="item">Third item</li>
</ul>
<script>
  $("body").search();
</script>

$.search attributes

When we run $('body').search(), the body is called a “container”. It listens to events on “triggers”, like <... data-search="...">

Search triggers support these attributes:

Search containers support these attributes:

$.search events