Using Easy Pie Chart, I am trying to change the value of attribut data-percent with value from JSON, but using the ways I normally do in jQuery (3.5.1), does not work in this case, and I cannot figure out why.
The DIV I am trying to set the data-percent on is:
<div class="chart easy-pie-chart-1" id="ConversionCostPercentage" data-percent="">
<span class="percent1"></span>
</div>
The jQuery I have tried to set the value with :
$('#ConversionCostPercentage').attr('data-percent', thejson.ConversionCostPercentage);
and
$('#ConversionCostPercentage').data('percent', thejson.ConversionCostPercentage);
Doing a console.log(thejson.ConversionCostPercentage) returns 55 at the moment .. Anyone have a clue?