From d6ff4169794555b05bf736facad390705971661f Mon Sep 17 00:00:00 2001 From: lolabird Date: Thu, 9 Nov 2023 18:26:41 -0700 Subject: [PATCH] Get background to change on mouseover --- script.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index 6955e73..a30685e 100644 --- a/script.js +++ b/script.js @@ -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"; }