title: jQuery - Click on optgroup selects all child options
body: <p>How can I make an optgroup in a select tag clickable in html. When we click this label, all its child options should be selected.</p>
  
  <p>Example: Selecting the <code>optgroup</code> with label Swedish Cars should automatically select the Volvo and Saab options.</p>
  
  <pre><code>&lt;select&gt;
    &lt;optgroup label="Swedish Cars"&gt;
      &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
      &lt;option value="saab"&gt;Saab&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="German Cars"&gt;
      &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
      &lt;option value="audi"&gt;Audi&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>