I am attempting to dynamically create 121 divs using the DOM and then add them to the .container div
const container= document.querySelector('.container');
const divNumber= 121;
for (let i= 0; i<= 121; i++){
const divs= document.createElement('div');
divs.classList.add('items');
container.appendChild(divs);
}
.container {
display: grid;
grid-template-columns: auto auto auto auto auto auto auto auto auto auto auto;
}
.items {
border: 1px solid black;
margin: 0px;
}
<div class='container'></div>
There doesn't appear to be any changes on the webpage. How can I generate a group of 11 by 11, totaling 121 divs with the use of the DOM and insert them into the parent div, which is .container in this instance?