Jquery Live Search Filter Example with Demo

Today, We want to share with you Jquery Live Search Filter Example with Demo.In this post we will show you How To Create a Filter/Search List using jquery, hear for jQuery Search, sort, filters, flexibility to tables and list we will give you demo and example for implement.In this post, we will learn about jQuery Filtering – Simple Data Filtering Using jQuery with an example.

Jquery Live Search Filter Example with Demo

There are the Following The simple About Jquery Live Search Filter Example with Demo Full Information With Example and source code.

Read Also:  Vuejs Live Search Filter Example with Demo

As I will cover this Post with live Working example to develop Simple search filter using jQuery, so the Filtering List Data with a jQuery-searchFilter Plugin for this example is following below.

Example 1 : Jquery Search Filter

index.html File (HTML Interface source code)

For this Jquery Search Filter Example, I am giving it the id livesearch

jQuery simple keyup function

$("#livesearch").keyup(function() {
	var myval = this.value;

	$("table").find("tr").each(function(index) {
		if (!index) return;
		var getid = $(this).find("td").text();
		$(this).toggle(getid.indexOf(myval) !== -1);
	});
});
	

$("table").find("tr").each(function(index) {}) jQuery function will execute or run the all statement lets stated below it each special time the run HTML table row Data content tr or td matches the all data value fetched from the find or search each field.

Read Also:  JQuery Sortable elements using drag and drop

jQuery Search Filter Plugins Example

Example 2 : Simple search filter using jQuery

Step 1) Copy this jQuery to your Application

Step 2) Include [data-search] to search input

	<div class="search">
		
	</div>

Step 3) Include [data-filter-member] to the items that should be filtered

  <div class="container">
	<div class="search">
		
	</div>
	<div class="items">
		<div>Jaydeep</div>
		<div>Rakesh</div>
		<div>Krunal</div>
		<div>Dhaval</div>
		<div>Mayur</div>
		<div>Hitesh</div>
	</div>
</div>

Step 4) Include [data-filter-name=”SEARCH TERM”] to the filter-items


$('[data-search]').on('keyup', function() {
	var termValue = $(this).val();
	var filterMembers = $('[data-filter-member]');

	if ( termValue != '' ) {
		filterMembers.addClass('valHide');
		$('[data-filter-member][data-filter-name*="' + termValue.toLowerCase() + '"]').removeClass('valHide');
	} else {
		filterMembers.removeClass('valHide');
	}
});
	

Step 5) Include Custom CSS Style

.container {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  width: 50%;
}
.search {
  margin-bottom: 29px;
}
[data-filter-member] {
  padding: 15px;
  background-color: #3d3d3d;
  border: 1px solid #fff;
}
.valHide {
  display: none;
}


Angular 6 CRUD Operations Application Tutorials

Read :

Read Also:  Read Connection String from Web.Config file in ASP.Net using C# and VB.Net

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Jquery Live Search Filter Example with Demo.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  How to Submit a Form Without Page Refresh Using jQuery?
  2. Read Also:  laravel datatables Server-side Processing
  3. Read Also:  Jquery $.grep() Multiple Conditions
  4. Read Also:  Everything You Need to Know About Date format in PHP
  5. Read Also:  Simple Jquery Search Filter Example
  6. Read Also:  Top 10 Advanced VueJS Interview Questions Answers
  7. Read Also:  jQuery Multidimensional Array name selector
  8. Read Also:  Filter Table Columns using Angular Example
  9. Read Also:  Check if a string is None or null in python
  10. Read Also:  AngularJS HTML DOM Manipulation Example