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)
4 Réponses
+ 1
Good, thanks so much
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
0
I meant the functionality, it's there already, but how do I make it function?
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>