I'm creating a pixel art maker with HTML, CSS, and vanilla JS. I've created my UI for the most part, but I can't get the functionality working. I've tried:
let cell = document.body.querySelectorAll('.grid-square');
cell.addEventListener('click', function() {
cell.style.backgroundColor = 'red';
});
But my page 'addEventListener' isn't a function. How do I get my JS to load after the HTML so I can get this to work?