JQuery UI Autocomplete callback

前端 未结 2 1995
故里飘歌
故里飘歌 2021-01-17 22:13

Is it possible to define a callback function to an input which JQuery Autocomplete plugin has been applied to.

I actually want to execute something on the onchange e

相关标签:
2条回答
  • 2021-01-17 22:36

    Following js1568 answer. Here it is how.

    $('selector').autocomplete({
       .
       .
       .
       change: function (event, ui) { 
           //your code
       },
       close: function (event, ui) { 
           //your code
       }
    })
    

    Use the close event too, if you want your code to be triggered after the user selects a value.

    0 讨论(0)
  • 2021-01-17 22:37

    http://api.jqueryui.com/autocomplete/#event-change

    Autocomplete has its own events that you should use.

    0 讨论(0)
提交回复
热议问题