Bootstrap Tutorial - Set up type ahead








The following code shows how to set up type ahead.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<style type='text/css'>
@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');
.container {<!--from w  w  w  .  j  a  va 2s  .co m-->
  margin-top: 10px;
}
</style>
</head>
<body>
  <div class="container">
    <div class="hero-unit">
      <form>
        <div>
          <label>typeahead</label> 
          <input type="text" data-provide="typeahead" autocomplete="off"
            data-source='["hello","world"]' />
        </div>
      </form>
    </div>
  </diV>
</body>
</html>

Click to view the demo