javascript filter in html in input

Solutions on MaxInterview for javascript filter in html in input by the best coders in the world

showing results for - "javascript filter in html in input"
Sterling
28 Jun 2016
1<!DOCTYPE html>
2<html>
3<head>
4<meta name="viewport" content="width=device-width, initial-scale=1">
5<style>
6* {
7  box-sizing: border-box;
8}
9
10#myInput {
11  background-image: url('/css/searchicon.png');
12  background-position: 10px 12px;
13  background-repeat: no-repeat;
14  width: 100%;
15  font-size: 16px;
16  padding: 12px 20px 12px 40px;
17  border: 1px solid #ddd;
18  margin-bottom: 12px;
19}
20
21#myUL {
22  list-style-type: none;
23  padding: 0;
24  margin: 0;
25}
26
27#myUL li a {
28  border: 1px solid #ddd;
29  margin-top: -1px; /* Prevent double borders */
30  background-color: #f6f6f6;
31  padding: 12px;
32  text-decoration: none;
33  font-size: 18px;
34  color: black;
35  display: block
36}
37
38#myUL li a:hover:not(.header) {
39  background-color: #eee;
40}
41</style>
42</head>
43<body>
44
45<h2>My Phonebook</h2>
46
47<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.." title="Type in a name">
48
49<ul id="myUL">
50  <li><a href="#">Adele</a></li>
51  <li><a href="#">Agnes</a></li>
52
53  <li><a href="#">Billy</a></li>
54  <li><a href="#">Bob</a></li>
55
56  <li><a href="#">Calvin</a></li>
57  <li><a href="#">Christina</a></li>
58  <li><a href="#">Cindy</a></li>
59</ul>
60
61<script>
62function myFunction() {
63    var input, filter, ul, li, a, i, txtValue;
64    input = document.getElementById("myInput");
65    filter = input.value.toUpperCase();
66    ul = document.getElementById("myUL");
67    li = ul.getElementsByTagName("li");
68    for (i = 0; i < li.length; i++) {
69        a = li[i].getElementsByTagName("a")[0];
70        txtValue = a.textContent || a.innerText;
71        if (txtValue.toUpperCase().indexOf(filter) > -1) {
72            li[i].style.display = "";
73        } else {
74            li[i].style.display = "none";
75        }
76    }
77}
78</script>
79
80</body>
81</html>
82
queries leading to this page
creating a search bar in javascriptsearch bar in javascripthow to make a working search bar in javascripthow to create search using javascripthow to make a search bar in javascriptinput with filterjavascript search bar searching boxshow to make search in javascriptfilter input array jsscript for search box in javascript codhtml input filterhow to make a search bar search javascriptjs build a search barsearch bar how to make it work in jshow to do a search bar in jshow to create a search bar with javascriptsearch bar using form in javascriptsearch bar with javascript js input filterhow to make search using javascriptcreate a search bar in html css jshow to make a search bar node jscreate search in javascripthow to add search bar javascriptbuilding a search box with javascripthow to make a search bar in hjscreate search function javascripthow to create a search bar in jshow to make search box functional in javascriptsearch bar html javascripthow to create search function in javascriptbuild search bar in javascriptsearch bar javascripthow to add search bar in jscreating working search box with jssearch bar with html and jsw3schools javascript search barsearch bar using javascriptcreating a search bar with search button in javascripthow to make a search button in domjs make search barsearch box with javascriptarray filter in input value javascriptchange search bar jsworking search bar javascripthow to make a search bar functional with javascriptcreate search with jssearch bar using jshow to make a search box in jsadd a search bar with javascripthow to create a search bar javascriptcreate search box javascripthow to create searchbar in javascriptjavascript simple search boximplement search bar in javascriptsearch box functionality in javascriptsearchbar javascriptsearch bar function in javascriptmake a search in jssearch field jsjs implement search barsearchbar maken jsexecute javascript from search barhow to make a javascript searchhow do i connect a button to a search field jscreate search box element javascripthow to make a search bar with javascriptcreate search bar javascriptcreating a search function in javascriptmake search bar javascripthow to create search box using domhow to make a search bar nodejshow to create a search bar in javascript and display resultscript for search box in javascriptcreate search bar in javascript show the datajavascript search barscreate search box in javascripthow to search bar work jshow to do searchbar jshow to create a search bar in javascriptsearch bar jaavscriptcustom search implementation in javascripthow to connect search bar javascriptfilter inputsjavascript filter list with inputfilter inputhow to create js fuction which write in search boxjs make a search boxcreate a search box in html javascripthow to create a searchbox jssearch bar using html and javascriptworking search bar html javascripthow to make a search bar function in javascriptcreate a search function in javascripthow to make a search functionality in javascriptcreate search bar in javascripthow to do a quick search bar in javascriptsearch bar java scriptsearch box in javascriptsearch bar javascript tutorialsearch bar js codesearch bar logic javascriptcreate a javascript search barsimple search bar jshow to make a search bar for your website jscreate a search in javascripthow to create search box in html using javascripthow to set up a search bar with jscreate a search menu jshow to create search in javascriptsearch bar in jssearch bar maken jshow to make a search bar that finds relevant searchs jshow to make a search with javascripthow to make a search bar jshow to use the search bar function in javascriptcreate a search bar in javascriptinput filtercreate a search box in javascriptdevelop javascript search barhow to create search bar in jsjavascript search barhtml javascript add search barhow to add search bar in javascripthow to create search bar in javascriptjavascript filter in html in input