$ (function() {
var heroes = [
"Abaddon",
"Alchemist",
"Ancient Apparition",
"Anti-Mage",
"Axe",
"Bane",
];
document.getElementById('searchBar').onkeyup = searchDropDown;
function searchDropDown(){
var search = heroes[i];
for (var i = 0; i < search.length; i++) {
if (search.indexOf(document.getElementById("searchBar"))> - 1) {
alert("Sucess")
}
}
}
});
So this is my javascript code and I can't get it to work. Trying to understand how to make a search bar with a dropdown list, same as the one as facebook has.
Anyone that can help me or kindly put me in the right path? :)