const html = [...Array(3)].map((n, i) => `<div class="count">${++i}</div>`).join('');
document.querySelectorAll('.counts').forEach(n => n.insertAdjacentHTML('beforeend', html));
или
const counts = document.querySelectorAll('.counts');
for (let i = 0; i < counts.length; i++) {
for (let j = 0; j < 3; j++) {
const el = document.createElement('div');
el.className = 'count';
el.innerText = j + 1;
counts[i].appendChild(el);
}
}
или
const div = document.createElement('div');
div.classList.add('count');
const fragment = document.createDocumentFragment();
fragment.append(...Array.from({ length: 3 }, (n, i) => (
n = div.cloneNode(),
n.textContent = -~i,
n
)));
for (const n of document.querySelectorAll('.counts')) {
n.append(fragment.cloneNode(true));
}