0

Search button

How do I integrate the search input on my website (so it could search for the music files on my upload page)

18th Apr 2020, 7:57 PM
Olamide Kosile
Olamide Kosile - avatar
4 odpowiedzi
+ 1
Good, thanks so much
18th Apr 2020, 9:28 PM
Olamide Kosile
Olamide Kosile - avatar
0
Olamide Kosile this is similar to what I did here using the < li > tags and < a tags. This is ofcourse a rough design. https://code.sololearn.com/Wmy13LJwxIXZ/?ref=app
18th Apr 2020, 9:22 PM
BroFar
BroFar - avatar
0
I meant the functionality, it's there already, but how do I make it function?
18th Apr 2020, 9:25 PM
Olamide Kosile
Olamide Kosile - avatar
0
<script> function search() { var input=document.getElementById("search"); var ucase=input.value.toUpperCase(); var projectlist=document.getElementById("SearchMe"); var listitem=projectlist.getElementsByTagName("li"); for (var i = 0; i < listitem.length; i++) { var a = listitem[i].getElementsByTagName("a")[0]; if (a.innerHTML.toUpperCase().indexOf(ucase) > -1) { listitem[i].style.display = ""; } else { listitem[i].style.display = "none"; } } } </script>
18th Apr 2020, 9:26 PM
BroFar
BroFar - avatar