title: How to select an item by text/label?
body: <p>OK. I see the duplicate link above..
  I'll try above and see if that works for me.
  Thanks.</p>
  
  <p>This should be something very simple, but I cannot find a way to do this.</p>
  
  <p>If I have a "select" control something like this:</p>
  
  <pre><code>&lt;select id="gate"&gt;
      &lt;option value='Gateway 1'&gt;Gateway A&lt;/option&gt;
      &lt;option value='Gateway 2'&gt;Gateway B&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I can use the .val() function to programmatically select an item by value like this:</p>
  
  <pre><code>$("#gate").val('Gateway 1');
  </code></pre>
  
  <p><strong>But if I want to use the text or the label to select an item, how do I do that? (i.e. I want to use the string "Gateway B" to select that option).</strong></p>
  
  <p>I've seen some stuff using "option", but haven't find a way to work.</p>
  
  <p>As you can tell I'm a newbie to the UI stuff.
  On the side, one other question I have is that a code like below:</p>
  
  <pre><code>$("#gate").val('Gateway 1');
  </code></pre>
  
  <p>Is that standard JavaScript?  JQuery? or HTML?
  Where can I find what sort of function I can call on $("#gate") object
  and what sort of options there are that I can pass and use?</p>