К
Size: a a a
К
К
IL
К
К
IL
К
IL
К
IL
К
𝓐
К
𝓐
function createSection() {
const element = document.createElement("div")
return { id: 0, element }
}
const sections = [
createSection(),
createSection()
]
document.body.append(...sections.map(({element}) => element))
let itemID = 0
document.body.onclick = () => {
const section = sections[Math.floor(Math.random() * 2)]
const item = document.createElement("div")
item.innerText = ++section.id
section.element.append(item)
}
К
К
К
𝓐
R