Bootstrap select dropdown list placeholder

前端 未结 19 1300
谎友^
谎友^ 2021-01-29 22:39

I am trying to make a dropdown list that contains a placeholder. It doesn\'t seem to support placeholder=\"stuff\" as other forms do. Is there a different way to ob

19条回答
  •  一个人的身影
    2021-01-29 23:18

    If you are initializing the select field through javascript, the following can be added to replace the default placeholder text

    noneSelectedText: 'Insert Placeholder text'

    example: if you have:

    
    

    in your javascript, you initialize the selectpicker like this

    $('.picker').selectpicker({noneSelectedText: 'Insert Placeholder text'});  
    

提交回复
热议问题