Jquery select change not firing
You can fire chnage event by these methods:
First
$('#selectid').change(function () {
alert('This works');
});
Second
$(document).on('change', '#selectid', function() {
alert('This Works');
});
Third
$(document.body).on('change','#selectid',function(){
alert('This Works');
});
If this methods not working, check your jQuery working or not:
$(document).ready(function($) {
alert('Jquery Working');
});
Try
$(document).on('change','#multiid',function(){
alert('Change Happened');
});
As your select-box is generated from the code, so you have to use event delegation, where in place of $(document)
you can have closest parent element.
Or
$(document.body).on('change','#multiid',function(){
alert('Change Happened');
});
Update:
Second one works fine, there is another change of selector to make it work.
$('#addbasket').on('change','#multiid',function(){
alert('Change Happened');
});
Ideally we should use $("#addbasket")
as it's the closest parent element [As i have mentioned above].
Try this
$('body').on('change', '#multiid', function() {
// your stuff
})
please check .on()
selector