title: Automatically update select options list using jQuery or Javascript?
body: <p>I have a select list that's generated by the Javascript code of my app</p>
  
  <pre><code>&lt;select name="addToContexts" id="addToContexts"&gt;
   &lt;option selected&gt;private&lt;/option&gt;    
   &lt;option&gt;public&lt;/option&gt;
   &lt;option&gt;shared&lt;/option&gt; 
  &lt;/select&gt;
  </code></pre>
  
  <p>What I need to do is that when the user performs a certain action the <code>selected</code> parameter shifts to another option, so that the result would be something like: </p>
  
  <pre><code>&lt;select name="addToContexts" id="addToContexts"&gt;
   &lt;option&gt;private&lt;/option&gt;    
   &lt;option selected&gt;public&lt;/option&gt;
   &lt;option&gt;shared&lt;/option&gt; 
  &lt;/select&gt;
  </code></pre>
  
  <p>Do you know if there's a way to do it without regenerating the whole <code>options</code> list simply using jQuery to get the <code>select</code> element by ID and to change the selected option?</p>
  
  <p>Thank you!</p>