$(document).ready(function() {
$("select").change(function() {
var clicked = $(this)
.find('option:selected') // get selected option
.parent() // get that option's optgroup
.attr("label"); // get optgroup's label
alert( clicked );
});
});
DEMO
Note
.click()
is wrong event you're using. see comment