how to refresh Select2 dropdown menu after ajax loading different content?

后端 未结 7 689
夕颜
夕颜 2020-12-08 19:42

I\'m using Select2 in a combination of dropdown menus. I have one menu for \"Countries\" and one for \"States/Provinces\". Depending on the country that is chosen, the \"Sta

7条回答
  •  遥遥无期
    2020-12-08 20:19

    select2 has the placeholder parameter. Use that one

    $("#state").select2({
       placeholder: "Choose a Country"
     });
    

提交回复
热议问题