Skip to content
Advertisement

Filter search for

I have a list of users as well:

JavaScript

what I want is a text input each time you write a letter to display only users that start with that letter or that they might have the name. As I can do? It is with jquery but not as …

Advertisement

Answer

Here is a input that filters a <ul> based on the value in pure JavaScript. It works by handling the onkeyup and then getting the <li>s and comparing their inner element .name with the filter text.

jsFiddle

enter image description here

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement