<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Mighty Gumball</title> <script src="mightygumball.js"></script> <link rel="stylesheet" href="mightygumball.css"> </head> <body> <h1>Mighty Gumball Sales</h1> <div id="sales"> </div> <script src="http://gumball.wickedlysmart.com/?callback=updateSales"></script> </body> </html> function updateSales(sales){ var salesDiv = document.getElementById("sales"); for (var i = 0; i < sales.length; i++){ var sale = sales[i]; var div = document.createElement("div"); div.setAttribute("class", "saleItem"); div.innerHTML = sale.name + " sold " + sale.sales + " gumballs"; salesDiv.appendChild(div); } }