title: Accessing dynamically created options in Selects with JQuery
body: <p>I have some Select elements being populated with updated options on an interval.  I'd like to access the new options programmatically to check whether a select contains an option with a certain value.  </p>
  
  <p>I've tried this snippet:</p>
  
  <pre><code>var exists = false;
  $('#select-box option').each(function(){
      if (this.value == 'bar') {
          exists = true;
          return false;
      }
  });
  </code></pre>
  
  <p>(From <a href="https://stackoverflow.com/questions/2248976/check-if-value-is-in-select-list-with-jquery">Check if value is in select list with JQuery</a>)</p>
  
  <p>But the options that this is exposing are only the placeholder options defined in the html.  How can I access the options that were created by pushing new html to the element?</p>
  
  <p>The selects are just defined as </p>
  
  <pre><code>&lt;select id=select-box&gt;&lt;option&gt;Placeholder&lt;/option&gt;&lt;/select&gt;.  
  </code></pre>
  
  <p>To update them, I'm passing several conjoined </p>
  
  <pre><code>&lt;option&gt;text&lt;/option&gt; 
  </code></pre>
  
  <p>tags to $("#select-box").html().</p>