me gustaria saber como podria hacer una resta entre las variables totalprice y total price2 y mostrarla en el label Lbtot
Aqui mi codigo :
$(function() {
$("input[type=checkbox]").change(function() {
var totalPrice = 0, ctlPrice;
$('.Gvcobranzas tr').each(function() {
if ($(this).find('input:checkbox').attr("checked")) {
ctlPrice = $(this).find('[id$= Label3]');
totalPrice += parseFloat(ctlPrice.text().replace(/[^\d\.]/g, ''));
}
});
$('.sum').text("$ " + totalPrice.toFixed(2));
});
});
$(function() {
$("input[type=checkbox]").change(function() {
var totalPrice2 = 0, ctlPrice2;
$('.GvNotasCredito2 tr').each(function() {
if ($(this).find('input:checkbox').attr("checked")) {
ctlPrice2 = $(this).find('[id$= Label20]');
totalPrice2 += parseFloat(ctlPrice2.text().replace(/[^\d\.]/g, ''));
}
});
$('.res').text("$ " + totalPrice2.toFixed(2));
});
});
}