Enabling jQuery Autocomplete on dynamically created input fields

前端 未结 5 1042
鱼传尺愫
鱼传尺愫 2021-01-05 15:23

I\'ve read almost every article i could find on how to accomplish this, but i\'m still failing miserably. mostly because i\'m an amateur at jQuery/Javascript.

I have

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 15:45

    You must bind autocomplete after adding new elements

    $(wrapper).find('input[type=text]:last').autocomplete({
                    source: availableAttributes
    }); 
    

    See example: http://jsfiddle.net/r08m8vvy/4/

提交回复
热议问题