I have downloaded bootbox.js in my project and implemented this code to show the pop up modal dialog but nothing errors or success result is printed in my console.I am getting confusing where the error is generated.
Js file
$('switch input[type="checkbox"]').on('change',function(){
var checkbox=$(this);
var checked=checkbox.prop('checked');
var dMsg=(checked)? 'You want to activate the product':
'You want to deactivate the product';
var value=checkbox.prop('value');
bootbox.confirm({
size: 'medium',
title: 'Product Activation & Deactivation',
message: dMsg,
callback: function(confirmed){
if(confirmed){
console.log(value);
bootbox.alert({
size: 'medium',
title: 'Information',
message : 'you are going to perform operation on product'+ value
});
}
else{
checkbox.prop('checked',!checked);
}
}
});
});
html file
<!-- toggle switch -->
<label class="switch">
<input type="checkbox" checked="checked" value="4" />
<div class="slider"></div>
</label>