let pixels = document.querySelectorAll(’.pixel’);
let chosenColor = document.querySelector(’.chosen-color’);
let eraser = document.querySelector(’.eraser’);
for (let pixel of pixels) {
pixel.onclick = function() {
pixel.style.backgroundColor = chosenColor.value;
if (eraser.checked) {
pixel.style.backgroundColor = ‘white’;
} }
}