JSFiddle - React, Tailwind, and code Playground
by Alex Azuero
HTML
<div class="holder">Billed Cost</div>
<div class="total">Total</div>
CSS
.holder, .total{
float:left;
margin-right:20px;
}
JavaScript
var html = '';
var sum = 0;
var dataUrl = 'http://data.cms.gov/resource/sq7j-n2ta.json';
$.getJSON(dataUrl, function(data){
$.each(data, function(i){
html += '<div class="billedCost">'+ data[i].average_estimated_submitted_charges + '</div>';
sum += parseFloat(data[i].average_estimated_submitted_charges);
});
$('.holder').append(html);
$('.total').append(sum);
});