Using JQuery fn to find out the specific element in the table

Suppose there are names and Id given for every individual person in a table and we want to find out the specific customer name &Id. We can use JQuery function to find out that. By using this fn:

<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>

Here #myInput is the input which we give and according to that it will filter the table(row by row).

Leave a comment

Your email address will not be published. Required fields are marked *