i am using a bootstrap-select item in a form and i' d like to get the optgroup value for the selected value when it gets selectet, so i can evaluate what to do based on that groups value:
$('select.selectpicker').on('change', function(e){
var picker_id=e.target.id;
var selected_value = $('.selectpicker option:selected').val();
var optgroup = ??
switch ( optgroup){
case "group_name":
break
}
});
Thanks for help.
You can try the following:
Example