I am making a request, which with this return, I create a class with the return name with the date attribute to be the value I want to perform the calculation.
It looks like this
I do not go for the whole request that is huge and is not the case
dados = $.parseJSON(data);
$.each(dados,function (key) {
$(".dataImposto").append(" <div class='row static-info align-reverse'> <div class='col-md-8 name '>"+dados[key].nome+" ("+dados[key].valor+"%)</div> <div id='imposto' class='col-md-3 value "+dados[key].nome.replace( /\s/g, '' ) + " ' data-class="+dados[key].nome.replace( /\s/g, '' )+" data-imposto="+dados[key].valor+" > </div> </div>");
});
It results in something like this
<div class="dataImposto">
<div class="row static-info align-reverse">
<div class="col-md-8 name "> DAS(11.50 % )
</div>
<div id="imposto" class="col-md-3 value DAS" data-class="DAS" data-imposto="11.50"> </div>
</div>
<div class="row static-info align-reverse">
<div class="col-md-8 name ">Imposto de Renda (15.00%)</div>
<div id="imposto" class="col-md-3 value ImpostodeRenda" data-class="ImpostodeRenda" data-imposto="15.00">
</div>
</div>
</div>
My problem is when I try to write in the generated tax class, for example, it gives me a return of undefined
How do I fix this?
Edit 1:
//faz a soma
valueSubTotal = parseFloat((totalLicenciamentos + totalOpcionais + totalGateways + totalHardwarePag + valUpdate + totalGarantia) - totalSuporte);
//exibe a soma no formato $0.000,00, não é gerado dinamicamente, aparece
$(".valueSubTotal").text(parseFloat(valueSubTotal, 10).toFixed(2).replace(/[.]/g, ",").replace(/\d(?=(?:\d{3})+(?:\D|$))/g, "$&.").toString());
//valor gerado dinamicamente, não aparece
$(".ImpostodeRenda").attr("data-class", "teste")