Clear dropdown using jQuery Select2

前端 未结 15 2139
情深已故
情深已故 2020-11-28 11:35

I\'m trying to programmatically clear a drop down using the fantastic Select2 library. The drop down is dynamically filled with a remote ajax call using the Select2 qu

15条回答
  •  鱼传尺愫
    2020-11-28 12:11

    Method proposed @Lelio Faieta is working for me, but because i use bootstrap theme, it remove all bootstrap settings for select2. So I used following code:

    $("#remote option").remove();
    

提交回复
热议问题