Dj.Sunrise Dj.Sunrise - 6 months ago 60
jQuery Question

silviomoreto / bootstrap-select [title] attribute

There is an attribute [multiple title] according silvio bootstrap-select documentation:

Here is documentation:
https://github.com/silviomoreto/bootstrap-select

<select class="selectpciker" multiple title='Choose one of the following...'>
<option>1</option>
<option>1</option>
</select>


It works well! But I need a single select ( not multiple ) . [title] attribute doesn't works without [multiple] attribute.

I didn't find a single title attribute in silvio bootstrap-select documentation.

Could anyone help me ?

Answer

You can use the data-hidden attribute on the first option..

<select class="selectpicker">
    <option data-hidden="true">Choose one</option>
    <option value="one">One</option>
    <option value="two">Two</option>
    <option value="three">Three</option>
</select>

Working demo: http://www.bootply.com/124596