allGreen = false;
element.style.backgroundColor = "green";
transform: scale(1.1);
}
var boxes = document.querySelectorAll(".box");
}
if (boxes[i].style.backgroundColor !== "green") {
if (allGreen) {
container {
function changeColor(element) {
element.style.backgroundColor = "white";
body {
cursor: pointer;
}
function checkWin() {
margintop: 50px;
}
alert("恭喜你,你赢了!");
for (var i = 0; i < boxes.length; i ) {
display: inlineblock;
fontfamily: Arial, sansserif;
textalign: center;
} else {
}
}
点击方块,看看能不能全部变成绿色!
if (element.style.backgroundColor === "green") {
width: 100px;
```html
transition: transform 0.3s ease;