I have a dropdown menu with different option groups. If someone selects an option, how can I check which optgroup it belongs to? For example if \'ferrari\' were selected, how wo
Well, in pure js:
this.options[this.selectedIndex].parentNode.label
Not a single function call and less code to boot. :-)