title: Javascript: Select option based on its contents
body: <p>Basically this, but in pure javascript:<br>
  <a href="https://stackoverflow.com/questions/2346257/how-to-get-value-of-select-tag-based-on-content-of-select-tag-using-nokogiri">How to get &#39;value&#39; of select tag based on content of select tag, using Nokogiri</a></p>
  
  <p>I have a select list with a lot of countries/states, and I want to be able to select one based on what is between the <code>&lt;option&gt;</code> tags.</p>
  
  <pre><code>&lt;option value="4783"&gt;Argentina&lt;/option&gt;
  </code></pre>
  
  <p>(I know I could use the value, but each one is a random mesh of numbers, so I would have to collect each individual one - not economical)</p>