Method 1 - Update Bootstrap-Select Version >1.7
Per the release notes in Version 1.7.0:
#888, #738: Show "title" when using a non-multiple select
A blank option is prepended to the select, which is then selected by
default. This allows the title to be shown when the select is initially
loaded and "no" options are selected yet.
<!-- language: lang-html -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/css/bootstrap-select.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/js/bootstrap-select.js"></script>
Demo with Stack Snippets:
<!-- begin snippet: js hide: true console: false babel: false -->
<!-- language: lang-html -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/css/bootstrap-select.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/js/bootstrap-select.js"></script>
<select class="selectpicker" >
<option data-hidden="true">Pick One</option>
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
<!-- end snippet -->
Method 2 - Hide empty option with CSS
You can hide the first <li>
element in the dropdown menu like this (although you'd probably want to base it off a class so it didn't happen by default).
<!-- language: lang-css -->
.bootstrap-select ul.dropdown-menu li:first-child {
display: none;
}
Demo with Stack Snippets:
<!-- begin snippet: js hide: true console: false babel: false -->
<!-- language: lang-css -->
.bootstrap-select ul.dropdown-menu li:first-child {
display: none;
}
<!-- language: lang-html -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/css/bootstrap-select.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/js/bootstrap-select.js"></script>
<select class="selectpicker" title="Pick One" >
<option></option>
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
<!-- end snippet -->
Method 3 - Hide empty option with data attributes
As suggested by @Antiga, you can hide the first option with data-hidden="true"
like this:
<!-- language: lang-html -->
<select class="selectpicker">
<option data-hidden="true">Pick One</option>
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
Demo with Stack Snippets:
<!-- begin snippet: js hide: true console: false babel: false -->
<!-- language: lang-html -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/css/bootstrap-select.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.0/js/bootstrap-select.js"></script>
<select class="selectpicker" >
<option data-hidden="true">Pick One</option>
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
<!-- end snippet -->