javascript - get some parameters to selected item in typeahead bootstrap -
I am using Twitter Bootstrap and I'm using this type-add I used this code:
$ ('# Demo1'). TypeHead ({Source: [{ID: 1, Name: 'Toronto', Country: 'USA'}, {ID: 2, Name: 'Montreal', Country: 'China'}, Country: 'China'}, ID: 5, Name: 'Boston' country, country: 'USA', country: 'USA'}, {id: 4, name: 'buffalo', country: 'isa'}, {id: 6, name: Country: 'Turkey'}, {ID: 7, Name: 'Dallas', Country: 'Italy'}, {ID: 8, Name: 'Vancouver' Country: 'Turkey'}, {ID: 9 , Name: 'Seattle', country: 'France'}, {ID: 10, name: 'Los Angeles', country: 'USA'}], items selected: displayRes});
and this displayRes
function
function displayRes (item, val, text) {console.log (val); Console.log (text); $ ('# Demo1') Val ('') }
When I get into the console val : the id of the selected item is & amp; Text : The name of the selected item is
but how can I get country in the displayRes
function?
Comments
Post a Comment