JSFiddle - React, Tailwind, and code Playground

by davidkonrad

HTML

<input name="test" id="test"/>
<button id="emu-select" class="btn btn-small" type="button">
<i class="icon-arrow-down"></i>
</button>

CSS

@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');

.container {
    margin-top: 10px;
}

JavaScript

$(document).ready(function() {

$("#test").typeahead({
    "source": ['Pennsylvania','Connecticut','New York','Maryland','Virginia'],
    //match any item
    matcher : function (item) {
        return true;
    },
    //avoid highlightning of "a"
    highlighter: function (item) {
        return "<div>"+item+"</div>"
    }
});

// "select"-button
$("#emu-select").click(function(){
    //add something to ensure the menu will be shown
    $("#test").val('a');
    $("#test").typeahead('lookup');
    $("#test").val('');
});

});