I am attempting to use the Bootstrap typeahead – but have no luck getting it to work. I have tried both using data-source as well as manually with Javascript. My latest example is:
<input class="typeahead" type="text"/>
<script type="text/javascript">
$(function(){
$('.typeahead').typeahead({
items:4,
source: ['Aaaa', 'Abbb', 'Accc']
});
});
</script>
I am using jQuery 1.7.2… and yes, the jquery is propery loaded as I have other plugins that use jQuery and they all work properly. What could be the problem?
Just figured it out. It was a CSS problem. I had customized my CSS download (I only want the typeahead) and left out other items I needed – IE, the typeahead uses a dropdown box. I didn’t include that to begin with.