javascript – Twitter typeahead not highlighting the element-ThrowExceptions

Exception or error:

I have a drop-down list and when I look for something in the search and try to select by giving the arrow down, it is not shading and/or highlighting the element. I am using typeahead.js for that.

$('#theSearchBox').typeahead({
    hint: true,
    highlight: true,
    minLength: 1
  },
  {
    name: 'HOUSES',
    source: substringMatcher(

      function(){
        let items=[];
        for(let key in SCHOOLS){
          items.push(HOUSES[key].House);
        }
        return items;
      }()

    ),
    limit: 10
  }
  );

  $('#theSearchBox2').typeahead({
    hint: true,
    highlight: true,
    minLength: 1
  },
  {
    name: 'HOUSES',
    source: substringMatcher(

      function(){
        let items=[];
        for(let key in HOUSES){
          items.push(HOUSES[key].House);
        }
        return items;
      }()

    ),
    limit: 10
  }
  );   
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *