i have some json response which contains data in array format.i have to display that data one by one in html page.in my html page i added some div element for merchantname,productname and remove button.and json data contanins array of same product name,merchant name,remove button for specific merchant.now when i am displaying data in page its showing me all the name of merchant after that list of product.means it is like merchant name:abc merchantname:xyz
productname:a1 productname:a2 remove button for merchant1 remove button for merchant2 but i want to display this data like merchantname:abc productname:a1 remove button for merchnant1 merchantname:xyz productname:a2 remove button for merchnant2 this is the code
$("#merchantname").append("<font color='green'>"+(responseObj.merchants.merchantname[i])+"</font>"+"\n");
$("#productname").append(responseObj.merchants.productname[i]+"\n");
$("#remove").append("<input type='button' value='remove' onClick='remove(needID)'>"+"</input>"+"\n");
jsrender
or simply iterate the json array to append in your page..