title: Set selected value of typeahead
body: <p>I am using the <a href="http://twitter.github.io/bootstrap/javascript.html#typeahead" rel="noreferrer">twitter bootstrap typeahead</a>.</p>
  
  <p>I have customized the typehead so I can select a pair <strong>value/label</strong></p>
  
  <pre><code>$.each(data.medicines,function(index,values){
  
      _med=new Object()
      _med.value=values.LYF
      _med.id=values.LYF_NUMER
      _medicines.push(_med)
  
  })
  
  //Fill typeahead with data
  $('.typeahead').typeahead({
      // note that "value" is the default setting for the property option
      source:_medicines,
      onselect: function(obj) { showdetails(obj) }
  })
  </code></pre>
  
  <p>How can I set the selected value using Javascript ?</p>
  
  <pre><code>For exemple $("#mytypehead").val(43);
  </code></pre>