silviomoreto / bootstrap-select [title] attribute

Dj.Sunrise picture Dj.Sunrise · Mar 25, 2014 · Viewed 9.7k times · Source

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

Zim picture Zim · Mar 25, 2014

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