Without "option:selected"
$("#dataPicker").val('default');
$("#dataPicker").selectpicker("refresh");
You can write it in one single line reduces extra piece of code.
$("#dataPicker").val('default').selectpicker("refresh");
you can easily solve this problem by adding the autocomplete attribute to the select-element and set it to "off".
<select id="dataPicker" class="selectpicker form-control" autocomplete="off">
<option value="default" selected="selected">Default</option>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With