fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Bootstrap typeahead 使用选项实例</title> <link href="/jscss/bootstrap/v3/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="/jscss/bootstrap/v3/jquery.js"></script> <script src="/jscss/bootstrap/v3/bootstrap-typeahead.js"></script> <script> var subjects = ['PHP', 'MySQL', 'SQL', 'PostgreSQL', 'HTML', 'CSS', 'HTML5', 'CSS3', 'JSON']; $('#search').typeahead({source: subjects}) </script> </body> </html>
运行结果