How to add a specific class to select2 drop element?

后端 未结 4 2336
再見小時候
再見小時候 2021-02-18 18:23

I have select2 customized via css with its general classes and ids.

Now, I\'m trying to customize a specific class that will be provided to select2 and then apply in css

4条回答
  •  不思量自难忘°
    2021-02-18 18:47

    You can use dropdownCssClass for adding class to the select2-drop. I read whole plugin to understand what is going on. Finally, I found that option.

     $(".jSelectbox").select2({
         containerCssClass: "error",
         dropdownCssClass: "test"
     });
    

    $(".jSelectbox").select2({
      containerCssClass: "error",
      dropdownCssClass: "test"
    });
    
    
    
    

    Jsfiddle

提交回复
热议问题