English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
jQuery can be used for filtering/Search for a specific element in a set of elements.
jQuery filter()The method returns elements that match the specific conditions.
This method filters out all elements that do not meet the selected conditions and returns those that match.
The following example performs a case-insensitive search on the items in the table:
Enter content in the input field to search for names, cities, or phones in the table:
Name | City | Phone |
---|---|---|
Seagull | New Delhi | 999945850 |
Espy | Midazolam | 8425896528 |
Mudit | Jaipur | 9858621233 |
Ankit | Mumbai | 9560478555 |
Nancy | New Delhi | 9210154545 |
filter()Method to check if any text value matches the value of the input field
toggle()Method to hide lines that do not match the search
toLowerCase()Method to convert text to lowercase, making the search case-insensitive
The following example performs a case-insensitive search on the items in the list:
Enter content in the input field to search list items:
London
New Delhi
Beijing
Mumbai
Bangalore
The following example performs a case-insensitive search within the DIV element:
Enter content in the input field:
This is the first paragraph.
This is the second paragraph.
This is the last paragraph.