$('.victim').html(''); //clear the victim if needed $('.victim').each((index, element) => { var htmlString = ''; htmlString += '' + element.text + ''; htmlString += ''; $('.victim').append(htmlString); //add the current content to existing one }); //end each