I have the following dropdown using Semantic UI:
It seems that onChange
setting can be added when creating the dropdown:
$(".select-language").dropdown({
onChange: function (val) {
alert(val);
}
});
JSFIDDLE
Actually, there are three ways to bind the event:
// globally inherited on init
$.fn.dropdown.onChange = function(){...};
// during init
$('.myDropdown').dropdown({
onChange: function() {...}
});
// after init
$('.myDropdown').dropdown('setting', 'onChange', function(){...});
jQuery('.ui.ekstensi.fluid.dropdown').dropdown('setting','onAdd',function (val,text,choice) {
alert(choice);
}).dropdown('setting','onRemove',function (removedValue, removedText, removedChoice) {
//your action here
alert(removedValue);
});
JSFIDDLE