菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Bootstrap typeahead 使用选项实例</title> <link href="/try/bootstrap/twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="well"> <input type="text" class="span3" id="search" data-provide="typeahead" data-items="4" /> </div> <script src="/try/bootstrap/twitter-bootstrap-v2/docs/assets/js/jquery.js"></script> <script src="/try/bootstrap/twitter-bootstrap-v2/docs/assets/js/bootstrap-typeahead.js"></script> <script> var subjects = ['PHP', 'MySQL', 'SQL', 'PostgreSQL', 'HTML', 'CSS', 'HTML5', 'CSS3', 'JSON']; $('#search').typeahead({source: subjects}) </script> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net