Code works on my computer but won't run on the SoloLearn IDE...
(Edited after @naomi 's answer) This is the code: var e = document.getElementById('container') var v = gridSize var sizePercentage = 100/gridSize for(i = 0; i < v; i++){ var row = document.createElement("div") row.className = "row" row.style.height = `${sizePercentage}%` row.style.width = '100%' for(x = 0; x < v; x++){ var cell = document.createElement("div") cell.className = "gridsquare" cell.id = `id${i}${x}` // cell.innerText = '1' // cell.innerText = `${i}${x}` cell.style.height = '100%' cell.style.width = `${sizePercentage}%` row.appendChild(cell); } e.appendChild(row); } I get this message: Uncaught TypeError: Cannot read property 'appendChild' of null Line: 30 Line 30 is the second to last : e.appendChild(row); Thanks!