Get background to change on mouseover
This commit is contained in:
parent
ad87353175
commit
d6ff416979
1 changed files with 2 additions and 4 deletions
|
|
@ -21,15 +21,13 @@ function createGrid() {
|
||||||
const gridItems = document.querySelectorAll(".grid");
|
const gridItems = document.querySelectorAll(".grid");
|
||||||
|
|
||||||
gridItems.forEach((item) => {
|
gridItems.forEach((item) => {
|
||||||
item.addEventListener("mouseover", () => {
|
item.addEventListener("mouseover", colorGrid);
|
||||||
console.log("Sup!");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function colorGrid() {
|
function colorGrid() {
|
||||||
container.style.background = "blue";
|
this.style.background = "blue";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue