title: How to make an option as selected in the list using Jquery in JQM based website
body: <p>I have a code which is something like this</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div data-role="page" id=""&gt;
  &lt;select id="selectOption"&gt;
      &lt;option value="0"&gt;Others&lt;/option&gt;
      &lt;option value="1"&gt;Koramangala&lt;/option&gt;
      &lt;option value="2"&gt;BTM&lt;/option&gt;
      &lt;option value="3"&gt;BTM&lt;/option&gt;
      &lt;option value="4"&gt;BTM&lt;/option&gt;
  &lt;/select&gt;
  &lt;div id="otros"&gt;
      &lt;input type="text" id="a1" placeholder="Write something" /&gt;
      &lt;button id="a2"&gt;Klick me&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Script</strong></p>
  
  <pre><code>   $(document).on('vclick', '#a2', function (e) {
      var itemID = $('#a1').val();
      if (itemID == 0 || itemID == '') {} else {
          $("#selectOption").append('&lt;option selected="selected" value="' + itemID + '" &gt;' + itemID + '&lt;/option&gt;');
          $('#otros').hide();
      }
  });
  </code></pre>
  
  <p>The above code when you write something in the input text and click the button it adds the option to the <code>select</code> menu . </p>
  
  <p>My question is how I can make the option to be selected in the <code>select</code> option when you add the new item .</p>
  
  <p>I am using JQM and JQuery</p>
  
  <p><a href="http://jsfiddle.net/Vicky_Anand/4MTa7/2/" rel="nofollow"><strong>Here is the FIDDLE</strong></a> that I have created .</p>
  
  <p>Thanks &amp; Regards </p>