Wednesday, February 9, 2022

jQuery filter/search function in table




https://www.w3schools.com/bootstrap/bootstrap_filters.asp# 

<script>
$(document).ready(function(){
  $("#myInput").on("keyup", function() {
    var value = $(this).val().toLowerCase();
    $("#myTable tr").filter(function() {
      $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
    });
  });
});
</script>

 

No comments:

Post a Comment