I am currently trying to create an autocomplete with a source that is stored in a javascript variable but this variable can be updated by another function. So, what I would like is that at each time the user updates the autocomplete field, the source field of autocomplete is generated.
Here is the code I use:
var availableTags = ['java', 'javascript']
// can be called anytime
var addToTags = function(str){availableTags.push(str)}
$(function() {
$( "#tags" ).autocomplete({
source: availableTags
});
});
Do I need to do a callback-like function?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)