title: set selected value of select field if option with that value does not exist
body: <p>I want to set the selected value of a select box if it exists, and to add it to the select box if it does not exist.</p>
  
  <p>How do I do that?</p>
  
  <p>I have:</p>
  
  <pre><code>&lt;select id="abc" name="abc"&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want: </p>
  
  <pre><code>  $('#abc').val(123);
  </code></pre>
  
  <p>afterwards:</p>
  
  <pre><code>&lt;select id="abc" name="abc"&gt;
  &lt;option value="123" selected&gt;
  &lt;/select&gt;
  </code></pre>