diff --git a/index.js b/index.js index 997b8d3..3433889 100644 --- a/index.js +++ b/index.js @@ -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);