I need to get the value of a data-attr that is generated from an ajax request.
The maximum I got was:
$('.dataImposto').on('click', '.ImpostodeRenda', function(){
$(".ImpostodeRenda").html("ooi");
});
The problem is that this "TaxTime" is generated dynamically from a return of an ajax.
Ajax Return
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 i class='col-md-3 value imposto "+dados[key].nome.replace( /\s/g, '' ) + "' data-class="+dados[key].nome.replace( /\s/g, '' )+" data-imposto="+dados[key].valor+" > </div> </div>");
});
HTML generated example
<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>
Look at what DAS is generated ...
I wanted to get the date-class and the date-tax of both.
Thank you in advance