title: Simulate javascript to choose from dropdown
body: <p>I am trying to simulate a javascript to choose from the dropdown list below. I am trying this code here but its not working. </p>
  
  <pre class="lang-js prettyprint-override"><code>$('select[name="srctype"]').val(2).trigger('change');
  </code></pre>
  
  <p>Am i doing something wrong here? Is my javascript messed up for this layout of code below?</p>
  
  <p>I am trying to choose <code>value="single"</code></p>
  
  <pre><code>&lt;select name="srctype" class="formselect" onchange="typesel_change()"&gt;
      &lt;option value="any" selected="selected"&gt;any&lt;/option&gt;
      &lt;option value="single"&gt;Single host or alias&lt;/option&gt;
      &lt;option value="network"&gt;Network&lt;/option&gt;
      &lt;option value="pptp"&gt;PPTP clients&lt;/option&gt;
      &lt;option value="pppoe"&gt;PPPoE clients&lt;/option&gt;
      &lt;option value="l2tp"&gt;L2TP clients&lt;/option&gt;
      &lt;option value="wan"&gt;WAN subnet&lt;/option&gt;
      &lt;option value="wanip"&gt;WAN address&lt;/option&gt;
      &lt;option value="lan"&gt;LAN subnet&lt;/option&gt;
      &lt;option value="lanip"&gt;LAN address&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>