title: JQuery : Iterate through all <option> elements in a multiple <select> element
body: <p>I have a multiple  element as follows:</p>
  
  <pre><code>&lt;select id="mySelect" multiple&gt;
     &lt;option value="1"&gt;Option 1&lt;/option&gt;
     &lt;option value="2"&gt;Option 2&lt;/option&gt;
     &lt;option value="3"&gt;Option 3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want to iterate through this multiple select list and read the values of all the options.  I have this JQuery on another page that iterates through all the selected options in a multiple select element like this:</p>
  
  <pre><code>$('#mySelect option:selected').each(function(){ ... });
  </code></pre>
  
  <p>How do I modify the above statement so that the .each will return all of the options one by one instead of only those that are selected?  </p>
  
  <p>I tried these:</p>
  
  <pre><code>$('#mySelect option').each(function(){ ... });    
  
  $('#mySelect option').children().each(function(){ ... });
  
  $('#mySelect option').children(function(){ ... });
  
  $('#mySelect &gt; option').each(function(){ ... });
  </code></pre>
  
  <p>but none worked.</p>
  
  <p>EDIT: Sorry everyone the typo was in my first statement on here then I copy/pasted it 4x's.  In my actual code the # is there but it does not work.</p>
  
  <p>UGGHHH LOL the error isn't with my JQuery but with my html select element.  I was using the name attribute instead of id.</p>