jquery search list

How we can create a search filter for list items using JS? Solution: See this jQuery Search List With Bootstrap Layout | Search List Filter Program.

Previously I have shared a search filter example, this is also similar to that but it is fast and with a smooth fade in and out animations. Basically, a search filter‘s work is filtering out the matching query which is given by the user. And this is important in every condition: on website, web app, mobile app, or any desktop software. Suppose a webpage contains a long list or table and you have to find a specific item, then it will very helpful.

Today you will learn to create a Search List Filter Program. Basically, there is a list with all country names and header section with title and search input. When you will click on the input and put any character then the list items will be filtering out according to the given query. During the filter items, there is cool fade-in and fade-out animation effects. This whole process is pretty cool and fast.

So, Today I am sharing jQuery Search List With Bootstrap Layout. There I have used bootstrap to create a responsive layout, CSS for styling and jQuery for functioning. For the font styles and icon placement, I have used google fonts service. There is a shortcode for filter contents easily, you can use it on your website. This search program filters content without refreshing like our control+F command.

If you are thinking now how this list search program actually is, then see the preview given below.

Preview Of List Filter Program

See this video preview to getting an idea of how this list filter program looks like.

Live Demo

Now you can see this program visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

jQuery Search List Source Code

Before sharing source code, let’s talk about it. First I have created the container div and create the whole layout according to Bootstrap’s grid layout. There I have created a list using HTML <ul> & <li> commands and placed all countries names. Also, I have placed a heading title, search input and search icon above the list. In the HTML file, I have linked other files like CSS, JS, and JQuery CDN link.

Now using CSS I have placed all the items in the right place, as you can see in the preview. This program is based on the bootstrap layout that’s why there is less custom CSS. With CSS I gave basic values like fonts, padding, margin, color, etc to all the elements. There I have used CSS @keyframe commands to create fade-in and fade-out animation effects.

JQuery handling here the search or filter function in this program. I have used jQuery indexOf(searchText) for search and filter out contents according to the user’s query. There I have used JS if{} else{} statements to declare the which animation effect will active on different conditions.

Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First file for HTML, second for CSS, and third for JavaScript. Follow the steps to creating this program without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created jQuery Search List With Bootstrap Layout, Search List Filter Program. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

2 COMMENTS

  1. Omg , thank you so much for you efforts
    , really it’s the first time that i find a very wonderful web site ,
    it’s help me a lot with every thing ,
    evry thing you need it you find it here and you find more thing too
    thank’s to god that i find your site :>

LEAVE A REPLY

Please enter your comment!
Please enter your name here