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 = $("#optionNetFlow")[0].selectize; selectize.clear();
But it gives the following error:
When I change it to this:
var selectize = $("#optionNetFlow").selectize; selectize.clear();
I gives this error:
What I am doing wrong here?
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 :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With