I have this JSON array
// Json array
var productList = {\"products\": [
{\"description\": \"product 1\", \"price\": \"9.99\"},
{\"description\": \"pr
Since you're already using jQuery, why don't you use the $.each() function?
Instead of this code:
var listItem = document.createElement('li');
listItem.setAttribute('id', 'listitem');
listItem.innerHTML = productList.products[0].description;
$(list).append(listItem);
Use this:
$(productList.products).each(function(index){
$(list).append('- ' + this.description + " = " + this.price + '
');
});