title: how to loop through select with custom attributes in jQuery
body: <p>I have a select dropdown with custom attributes that looks like this:</p>
  
  <pre><code>&lt;select id="myselect"&gt;
  &lt;option value="1" custattr="first"&gt;First One&lt;/option&gt;
  &lt;option value="2" custattr="second"&gt;Second One&lt;/option&gt;
  &lt;option value="3" custattr="third"&gt;Third One&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And I have a value or values that I want to test against to see if they are not present in the <code>custattr</code> of each option.</p>
  
  <p>I have tried variations of the following:</p>
  
  <pre><code>    jQuery('#myselect option').attr('custattr').each(function(){
          if (myvalue != jQuery(this).attr('custattr').val()) {
          //do something
         }
      });
  </code></pre>
  
  <p>but I get errors such as:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'each' of undefined</p>
  </blockquote>
  
  <p>How can I loop through to test against each <code>custattr</code> value?</p>