<optgroup label="Breeding" class="parent-option">
<option class="child-option" value="Foal Out" disabled style="font-weight: bold; color: #555555 " selected="false">Foal Out</option>
<option value="Breeding, Foal Out, General"> General</option>
<option value="Breeding, Foal Out, Report"> Report</option>
<option class="child-option" value="Gestation" disabled style="font-weight: bold; color: #555555 " selected="false">Gestation</option>
<option value="Breeding, Gestation,l General"> General</option>
<option value="Breeding, Gestation, Report"> Report</option>
<option class="child-option" value="Mare" disabled style="font-weight: bold; color: #555555 " selected="false">Mare</option>
<option value="Breeding, Mare, AI Cooled Semen"> AI Cooled Semen</option>
<option value="Breeding, Mare, AI Frozen Semen"> AI Frozen Semen</option>
</optgroup>
How can I get the the value of nearest child-option class and nearest parent-option class value when any of the option is selected from drop down.