twitter/bootstrap — Issue #2446: Can't update typeahead selected value
Author: tyroneschiff
Created: 2012-03-07 07:28:13+00:00
State: open

I retrieve the selected typeahead value by using this method: ```$('ul.typeahead li.active').data('value');```
If then set this equal to a variable, like so, ```var foo = $('ul.typeahead li.active').data('value');```
However, if I try and do something like this:
```var foo = $('ul.typeahead li.active').data('value').replace( /\([^\)]+\)$/, '' );```
it won't seem to update the value of ```foo``` even though when I console.log(foo) it actually is showing the right value for ```foo```.

Can you please tell me what I could do to resolve this?