How to set selected option with selectpicker plugin from bootstrap
<p>I am using the Bootstrap-Select:</p>

<pre><code>&lt;select name="SelectAddress" class="selectpicker"&gt;
   &lt;option value="a"&gt;Val 1&lt;/option&gt;
   &lt;option value="b"&gt;Val 2&lt;/option&gt;
   &lt;option value="c"&gt;Val 3&lt;/option&gt;
   &lt;option value="d"&gt;Val 4&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>For example, I want to change <code>Val 1</code> to <code>Val 1.0</code> knowing <code>Val 1</code> is selected.
So I tried with no success:</p>

<pre><code>$("select[name=SelectAddress]").text("Val 1.0");
$("select[name=SelectAddress]").selectpicker("refresh");
</code></pre>

<p>How can I achieve this?</p>

<p><strong>Edit:</strong></p>

<p>Found a solution, by inserting an ID on each <code>&lt;option&gt;</code>:</p>

<pre><code>&lt;select name="SelectAddress" class="selectpicker"&gt;
   &lt;option id="1" value="a"&gt;Val 1&lt;/option&gt;
   &lt;option id="2" value="b"&gt;Val 2&lt;/option&gt;
   &lt;option id="3" value="c"&gt;Val 3&lt;/option&gt;
   &lt;option id="4" value="d"&gt;Val 4&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Then:</p>

<pre><code>$("#1").html("Val 1.0");
$("select[name=SelectAddress]").selectpicker("refresh");
</code></pre>