+ 1
How to use forEach function ?
I'm trying to console log the value of button when pressing it but it gives me a error instead, what is the problem here is the code for some clarification. https://code.sololearn.com/WKHH7L9NApu8/?ref=app
3 ответов
+ 4
querySelector returns a single node, you can't use forEach on it.
querySelectorAll returns a list of nodes, and you can use forEach on it.
+ 2
Abderrahim Rhitrif np bro :)
+ 1
maf thanks man 💛