I see a couple of issues with the JavaScript part of the code. Let's walk through them and correct them:
- document.querySelectorAll(".numbers") returns a NodeList, but in your for loop, you're using numberOfbuttons directly, which will result in an error because you can't iterate over a NodeList like an integer. Instead, you need to get the length of the NodeList.
- The grid-area for the button[value="0"] is incorrect (grid-area: 5/2/5/2;). The grid-area property should be written as four values representing the start-row, start-column, end-row, and end-column, but the values you used are duplicated. If this was intended to position the button, it might need adjusting.
- You are statically setting the result to "1" for all buttons. You might want to dynamically set the result to the button's value when clicked.
let numberOfButtons = document.querySelectorAll(".numbers");
for (let i = 0; i < numberOfButtons.length; i++) {
numberOfButtons[i].addEventListener("click", function() {
document.querySelector(".result").innerHTML = this.innerHTML; // Update result with clicked button's value
});
}