How to change selected item in jQuery
<p>Hi I wrote that html codes and I want change selected item by using jQuery</p>

<pre><code>&lt;select id="slc"&gt; 
&lt;option value="1"&gt;1&lt;/option&gt;
&lt;option value="2"&gt;2&lt;/option&gt;
&lt;option value="3"&gt;3&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>I tried this but I can't change</p>

<pre><code>$("#slc").val("2");

$("#slc").prop("selectedIndex", 1);
</code></pre>