I am using Twitter Bootstrap. I've got the following code. When you click on an item from a typeaheadlist, a popover will open. But what I want to do is, when you click on a specific item, only then the popover should open.
$('#nr1').typeahead({
source: source,
updater: function(item) {
$('#nr1').popover({
placement: 'bottom',
content: function(e) {
return $('.addnr').html();
}
}).popover('show');
return item;
}
})
I tried the code below but it doesn't work.
$('#nr1').typeahead({
source: source,
updater: function(item) {
$('li').val('').on('click', function(item){
$('#nr1').popover({
placement: 'bottom',
content: function(e) {
return $('.addnr').html();
}
}).popover('show');
});
return item;
}
})
As you can see the li has a data-value=''.