Can anyone tell me what is wrong with my code? I am trying to create a grid using divs. This is what I have so far and I am not sure why it is not creating the grid. I have googled this so many times and I am at a loss for why it is not working. New to coding so any help would be greatly appreciated.
const container = document.querySelector('.container')
function makeGrid();
for (i = 0, i < 16, i++); {
const row = document.createElement("div")
container.document.body.appendChild(row);
row.textContent = i;
for (j = 0, j < 16, j++); {
const col = document.getElementById('div');
container.document.body.appendChild(col);
col.textContent = j;
}
row.appendChild(col)
container.appendChild(row)
}
makeGrid();
html,
body {
height: 100%;
width: 100%;
}
body {
display: grid;
grid-column-gap: 0px;
grid-row-gap: 0px;
grid-template-columns: repeat(3, auto);
}
.container {
width: 20px;
height: 20px;
text-align: center;
border: 1px solid blue;
background-color: pink;
display: inline-block;
float: left;
}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Etch-a-Sketch TOP Project</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script src="script.js"></script>
<div class="container"></div>
</body>
</html>