问题描述:

Using select2 is really cool but I would simply like my input to stay a simple, basic search box, without the fancy styling and formatting from select2. I couldn't find a way to achieve this yet.

Is there a simple way to do this?

Thanks

网友答案:

Try Bootstrap Typeahead

http://twitter.github.io/bootstrap/javascript.html#typeahead

//JS
var subjects = ['PHP', 'MySQL', 'SQL', 'PostgreSQL', 'HTML', 'CSS', 'HTML5', 'CSS3', 'JSON']; 
$('#search').typeahead({source: subjects})

//HTML
<div class="well">
 <input type="text" class="span3" id="search" data-provide="typeahead" autocomplete="off" data-items="4" />
</div>

See example here: http://jsfiddle.net/6XG8F/

相关阅读:
Top