@ -7,6 +7,9 @@ for(let y = 0; y < HEIGHT; y++) {
for(let x = 0; x < WIDTH; x++) {
const pixel = document.createElement('div');
pixel.className = 'pixel';
pixel.addEventListener('click', () => {
pixel.style.backgroundColor = 'red';
});
row.appendChild(pixel);
}
document.body.appendChild(row);