I would like some help.
I have the following code:
var totalBruto = 0;
var tot_desconto_vlr = 0;
var total = 0;
var totalLiquido = 0;
$(document).ready(function () {
$(".desc_vlr").on("input", function () {
totalBruto = $("#tot_bruto").val();
tot_desconto_vlr = $(this).val();
total = totalBruto + tot_desconto_vlr;
console.info(total);
var tot_liquido = $(this).attr("desconto");
$("#" + tot_liquido).val(total);
});
});
Instead of adding, it is concatenating example: 2 + 2 = 22
I would like to know what I'm doing wrong so I can add instead of concatenating.
Right now, thank you !!