How to change placeholder of selectize.js dropdown?

后端 未结 10 1390
盖世英雄少女心
盖世英雄少女心 2021-02-14 12:30

I want to change placeholder of a dropdown created by selectize.js when the parent dropdown changes its selection to load the options of the dropdown whose placeholder to be cha

10条回答
  •  遥遥无期
    2021-02-14 13:24

    You can specify a placeholder key as part of the options object when initialising. I couldn't find the option in the documentation and only found it digging through the code.

    //init selectize
    $(function() {
      $('select').selectize({
        placeholder: 'Click here to select ...',
      });
    });
    

提交回复
热议问题