You mean like this? No need for a P when you have a div for each thing
const data = {
"arr": [
{ "name": "Box", "reviews": 65, "img": 1 },
{ "name": "Drawer", "reviews": 70, "img": 2 },
{ "name": "Desk", "reviews": 20, "img": 3 },
{ "name": "Chair", "reviews": 76, "img": 4 },
{ "name": "Sofa", "reviews": 90, "img": 5 }
]
}
const html = data.arr.map(item => `<div class="row">
<div class="media"><img src=".img/${item.img}.jpg" /></div>
</div>
<div class="row">
<div class="product-title">${item.name}</div>
</div>
<div class="row">
<div class="reviews">${item.reviews}</div>
</div>`)
document.getElementById("container").innerHTML = html.join("")
<div id="container"></div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…