Does jQuery autocomplete work with a dynamic array as source

前端 未结 3 1483
执念已碎
执念已碎 2021-02-14 21:04

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

3条回答
  •  感动是毒
    2021-02-14 22:06

    this is very straight forward

    $( "#tags" ).autocomplete('option', 'source', availableTags)
    

    setting availableTags array wherever needed

提交回复
热议问题