title: Counting the number of option tags in a select tag in jQuery
body: <p>How do I count the number of <code>&lt;option&gt;</code>s in a <code>&lt;select&gt;</code> DOM element using jQuery?</p>
  
  <pre><code>&lt;select data-attr="dropdown" id="input1"&gt;
    &lt;option value="Male" id="Male"&gt;Male&lt;/option&gt;
    &lt;option value="Female" id="Female"&gt;Female&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I want to find the number of <code>&lt;option&gt;</code> tags in the <code>&lt;select&gt;</code> DOM element, since with that I want to open the settings panel with that number of input fields with the corresponding option value from the drop-down box in it and to change it again in the preview panel.</p>
  
  <p>The above drop-down box is in my preview panel which is generated by jQuery.</p>