jQuery AutoComplete Trigger Change Event

后端 未结 13 1118
陌清茗
陌清茗 2020-11-27 15:50

How do you trigger jQuery UI\'s AutoComplete change event handler programmatically?

Hookup

$(\"#CompanyList\").autocomplete({ 
    s         


        
13条回答
  •  孤街浪徒
    2020-11-27 16:30

    Here you go. It's a little messy but it works.

    $(function () {  
      var companyList = $("#CompanyList").autocomplete({ 
          change: function() {
              alert('changed');
          }
       });
       companyList.autocomplete('option','change').call(companyList);
    });
    

提交回复
热议问题