JSFiddle - React, Tailwind, and code Playground

by hieuh25

HTML

<script src="http://twitter.github.io/typeahead.js/js/hogan-2.0.0.js"></script>
<script src="http://twitter.github.io/typeahead.js/releases/latest/typeahead.js"></script>
<input type="text" class="typeahead">
    
<div id="hidden">Init value</div>

CSS

input.typeahead {
    float: left;
}

.twitter-typeahead {
    float: left;
}

#hidden {
    float: left;
    padding-left: 50px;
}

JavaScript

$('.typeahead').typeahead([{                              
    name: 'Title',                                                        
    local: ['abc', 'cghh', 'weyweh']
}]).change(function () {
    $('#hidden').text('');
}).bind('typeahead:selected', function(obj, datum) {
    $('#hidden').text(datum.value);
    
});