79607997

Date: 2025-05-06 05:05:31
Score: 1.5
Natty:
Report link

querySelectorAll() returns a NodeList, which is an array-like collection of DOM elements, not a single element. Since you're using .value, it's trying to access the value property of the NodeList itself, which doesn't exist.

To get the values of all the buttons, you'll need to loop through the NodeList and access the value property of each individual button.

Here's how you can modify your code:

This will log the value of each button to the console correctly.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Deepak Pranesh .V