I am using msdropdown and I am creating dropdown via function like this:
$("#select_holder_"+$_returnvalue.id+"").msDropDown({byJson:{data:jsonData, name:'change_member_status_'+$_returnvalue.id, width:'90'}}).data("dd");
Now I have in document ready:
$('select').on('change', function() {
alert( this.value );
});
But this isn’t triggered when changing dropdown created via function, (it is triggered on dropdowns created before documentready) and that behavior makes sense (as this is actually injected after documentready), but is there a way to attach onchange event for dropdowns created via function ?
You can delegate the event: