title: Search bar with dropdown results
body: <pre><code>$ (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 &lt; search.length; i++) {
  
         if (search.indexOf(document.getElementById("searchBar"))&gt; - 1) {
  
            alert("Sucess")
         }
      }
    }
  
  });
  </code></pre>
  
  <p>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. </p>
  
  <p>Anyone that can help me or kindly put me in the right path? :)</p>