I need to create html pages for multiple datas. I searched, then I found this document.getElementById("div-1").appendChild(container);
datas.forEach(function (data) {
var rptContainer = document.querySelector('.container').cloneNode(true);
rptContainer .querySelector('.customer-no').textContent = data.customerNo;
rptContainer .querySelector('.customer-name').textContent =data.customerName;
document.getElementById("div-1").appendChild(rptContainer);
});
It creates pages according to the number of data, but all the pages contain the information of the most recent data. How can I create pages according to each data (customer)?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/dhNjQMu
Comments
Post a Comment