i try to return some amount when user click checkbox and do some calculation. But the result always return wrong value if i try to check two checkbox.
$('.type_checkbox input[type="checkbox"]').each(function (index) {
if ($(this).is(':checked')) {
checkbox_price_prefix = $(this).data('prefix-checkbox');
checkbox_price = checkbox_price_prefix + $(this).data('price-checkbox'); // <----- += or =
}
});
You can try HERE
The problem is when user try to check type A and type B, the result suppose to be RM90
var optionCheckbox = function optionCheckbox() {is awesome.