Get background to change on mouseover

This commit is contained in:
lolabird 2023-11-09 18:26:41 -07:00
commit d6ff416979

View file

@ -21,15 +21,13 @@ function createGrid() {
const gridItems = document.querySelectorAll(".grid");
gridItems.forEach((item) => {
item.addEventListener("mouseover", () => {
console.log("Sup!");
});
item.addEventListener("mouseover", colorGrid);
});
}
function colorGrid() {
container.style.background = "blue";
this.style.background = "blue";
}