Twitter Bootstrap 2.0.4 Typeahead基本设置如何?

时间:2012-08-02 18:59:43

标签: twitter-bootstrap typeahead

我是一位有抱负的网页设计师,我自己学习,独自练习。现在我正在创建一个分类广告主题设计。

我想应用twitter bootstrap js plugin typeahed,我想要完成的只是设置插件,只是放一些虚拟源数据。

This is my html markup below:

<form class="well form-horizontal">
    <input class="city span3" type="text" data-provide="typeahead"/>
</form>

<form class="well form-horizontal"> <input class="city span3" type="text" data-provide="typeahead"/> </form>


    and this is what I type for the script... bye the way, I don't have deep understanding yet about jQuery or javascript.


    $(function() {$(".city").typeahead({
            source: ["Youtube","Facebook","Yahoo"]
            })
        });
    

1 个答案:

答案 0 :(得分:0)

试试这个:

$('.city').typeahead({
    source: ['Youtube', 'Facebook', 'Yahoo']
});