Hey guys,
Been out of the game for a while, been meaning to brush up for a long time.
Got a data coming back via AJAX from php, and im outputting an associative array. However when outputting to the html page the loop is over-writing the previous insert so you only ever get 1 element on the page.
Where am I going wrong?
To maybe help, some of the HTML layout for you

Been out of the game for a while, been meaning to brush up for a long time.
Got a data coming back via AJAX from php, and im outputting an associative array. However when outputting to the html page the loop is over-writing the previous insert so you only ever get 1 element on the page.
reviews.forEach(function(review) {
document.getElementById("reviews").innerHTML= '<div class="col-sm-4 portfolio-item" id="review"> <div class="review" data-stars="1,2,3,4,5"> <p class="reviewContent">' + review[0] + '</p> <p class="reviewName">' + review[1] + '</p> <div class="rating-score"> <div class="rating-5">' + review[2] + '</div> </div> </div> </div>';
)
Where am I going wrong?
To maybe help, some of the HTML layout for you
<section class="success">
<div class="container">
<div class="col-lg-12 text-center">
<h2>What our customers say</h2>
</br>
<div class="row" id="reviews">
</div>
</div>
</div>
</section>

Last edited: