title: How to set form option selected by value not by index
body: <p><a href="https://stackoverflow.com/questions/2343889/set-option-value-with-getelementsbyname/15136391#comment21306795_15136391">Here</a> i have read how to set a form option selected by index</p>
  
  <pre><code>&lt;select name="sel"&gt; 
    &lt;option value="o1"&gt;option1&lt;/option&gt;
    &lt;option value="o2"&gt;option2&lt;/option&gt;
  &lt;/select&gt;
  
  document.getElementsByName('sel')[0].selectedIndex = 0; or
  document.getElementsByName('sel')[0].selectedIndex = 1;
  </code></pre>
  
  <p>but is it possible to set an option selected by referencing an option value instead of index?</p>