How to clear a selected value in Selectize.js dropdown?

后端 未结 6 1704
离开以前
离开以前 2021-02-05 00:39

I have a selectize.js dropdown and I have to clear the selected value .

I have tried this (as suggested in another question):

var selectize = $(\"#option         


        
6条回答
  •  时光取名叫无心
    2021-02-05 00:51

    I finally found the answer here Selectize.js Demos

    What works for me is:

     var $select = $('#optionNetFlow').selectize();
     var control = $select[0].selectize;
     control.clear();
    

    what I was missing var $select = $('#optionNetFlow').selectize(); before applying the solution provided in above question's answer.

    Now I am to get all the functions in console like :

    enter image description here

提交回复
热议问题